Check http://en.cppreference.com/w/cpp/language/eval_order especially the part which discusses “Undefined behavior”. Basically it’s not a bug in the compiler. The language says what you’re doing is undefined.
More Related Contents:
- Redefinition C++ Issue, Multiple Header
- How does the compilation/linking process work?
- Where are static variables stored in C and C++?
- What’s the difference between __PRETTY_FUNCTION__, __FUNCTION__, __func__?
- how does array[100] = {0} set the entire array to 0?
- How to change mode from c++98 mode in Dev-C++ to a mode that supports C++0x (range based for)?
- What is special about numbers starting with zero?
- Best compiler warning level for C/C++ compilers? [closed]
- Do unused functions get optimized out?
- Can a recursive function be inline?
- Why does C need “struct” keyword and not C++?
- Can I separate C++ main function and classes from Objective-C and/or C routines at compile and link?
- What is difference between sjlj vs dwarf vs seh?
- Template within template: why “`>>’ should be `> >’ within a nested template argument list”
- What is the C++ compiler required to do with ill-formed programs according to the Standard?
- Update GCC on OSX
- Inadvertent use of = instead of ==
- Compiling with g++ using multiple cores
- Why are forward declarations necessary? [duplicate]
- What is Linux utility to mangle a C++ symbol name?
- Understanding stack frame of function call in C/C++? [closed]
- Why is the phrase: “undefined behavior means the compiler can do anything it wants” true?
- Why include guards?
- Template instantiation details of GCC and MS compilers
- C++ string literal data type storage
- Two classes that refer to each other
- c++ sizeof() of a class with functions
- Two ‘==’ equality operators in same ‘if’ condition are not working as intended
- What Rules does compiler have to follow when dealing with volatile memory locations?
- Does an R compiler to C/C++ exist?