I use this compilation lines:
icpc -std=c++98 -pedantic-errors integers.cc
To compile the following piece of code:
int i = 0b10101; std::cout << i << std::endl;
It compiles well and works perfectly (the output is 21).
To verify that i use the correct compiler flags I add the following line
auto g () { return 2.3; }
And indeed in this case I get the expected compiler error when using the compiler flags.
Binary literals is a feature that is supposed to exist only since C++14. So why does my code of binary literals compile? Is it icpc bug?
(With g++ and same flags, it works as expected and does not compile with the binary literals)