On Fri, 30 Dec 2011, Steve Kargl wrote: > I'm sorry, but I find "clang did this, so g++ better follow > suit" to be a rather uncompelling technical reason for > defining __cplusplus to be 201103L [1]. The technical question > is fairly simple: "Does g++ conform to the C++11 standard?"
I think this is just the same issue as where trouble.texi says: Sometimes people say that defining @code{__STDC__} in a compiler that does not completely conform to the ISO C standard somehow violates the standard. This is illogical. The standard is a standard for compilers that claim to support ISO C, such as @samp{gcc -ansi}---not for other compilers such as plain @command{gcc}. Whatever the ISO C standard says is relevant to the design of plain @command{gcc} without @option{-ansi} only for pragmatic reasons, not as a requirement. Note that -std=c++11 is documented to be incomplete, not to claim to support the full standard. I think the most pragmatically useful value of __cplusplus is to reflect the intent - the C++ version followed insofar as differences between versions are implemented - and this does not mean the support is complete, just as __STDC_VERSION__ had the C99 value with -std=c99 even in versions predating the implementation of C99 inline semantics (for example). -- Joseph S. Myers jos...@codesourcery.com