Look at this code snippet:
int a = 0xe+1;
Clang, gcc, icc don't compile this:
t.cpp:1:12: error: invalid suffix '+' on integer constant
MSVC successfully compiles.
Which compiler is correct? If clang and gcc are correct, why is this happening?
Note: if I add a space before +
, the code compiles. If I change 0xe
to 0xf
, it compiles too. Maybe this has to do something with exponential notation (like 1.2e+3
)?