Given test.cpp
#include <string> #include <cassert> class CPLString : public std::string { public: CPLString( const std::string &oStr ) : std::string( oStr ) {} }; int main() { CPLString osTest("test"); CPLString osTest2( 0 ? std::string() + osTest : osTest ); assert( !osTest.empty() ); }
$ icc -g -Wall -Wextra -std=c++11 test.cpp -o test && ./test
test: test.cpp:14: int main(): Assertion `!osTest.empty()' failed.
Whereas without -std=c++11 it doesn't assert.
On Ubuntu 16.04 64 bit. The same compiled with gcc 5.4 or clang 3.8 in C++11 doesn't assert.