diff mbox

[C++,docs] PR 56544

Message ID 51B2F1FD.2090600@oracle.com
State New
Headers show

Commit Message

Paolo Carlini June 8, 2013, 8:57 a.m. UTC
Hi,

the bug reminds us to update the documentation about the value of 
__cplusplus. I tentatively prepared the below, is it clear enough?

We could probably apply something to the branch too, without the 
-std=c++1y bits, thus end simply like '; or @code{201103L}, per the 2011 
C++ standard' or more verbosely say that with -std=c++1y too the value 
is 201103L.

Thanks,
Paolo.

///////////////////

Comments

Paolo Carlini June 18, 2013, 10:07 a.m. UTC | #1
Hi,

On 06/08/2013 10:57 AM, Paolo Carlini wrote:
> Hi,
>
> the bug reminds us to update the documentation about the value of 
> __cplusplus. I tentatively prepared the below, is it clear enough?
>
> We could probably apply something to the branch too, without the 
> -std=c++1y bits, thus end simply like '; or @code{201103L}, per the 
> 2011 C++ standard' or more verbosely say that with -std=c++1y too the 
> value is 201103L.
Is this patch straightforward enough to go in? Opinions about the branch?

Thanks...
Paolo.
diff mbox

Patch

Index: doc/cpp.texi
===================================================================
--- doc/cpp.texi	(revision 199792)
+++ doc/cpp.texi	(working copy)
@@ -1926,11 +1926,11 @@  facilities of the standard C library available.
 This macro is defined when the C++ compiler is in use.  You can use
 @code{__cplusplus} to test whether a header is compiled by a C compiler
 or a C++ compiler.  This macro is similar to @code{__STDC_VERSION__}, in
-that it expands to a version number.  A fully conforming implementation
-of the 1998 C++ standard will define this macro to @code{199711L}.  The
-GNU C++ compiler is not yet fully conforming, so it uses @code{1}
-instead.  It is hoped to complete the implementation of standard C++
-in the near future.
+that it expands to a version number.  Depending on the language standard
+selected, the value of the macro is @code{199711L}, as mandated by the
+1998 C++ standard; @code{201103L}, per the 2011 C++ standard; an
+unspecified value strictly larger than @code{201103L} for the experimental 
+languages enabled by @option{-std=c++1y} and @option{-std=gnu++1y}.
 
 @item __OBJC__
 This macro is defined, with value 1, when the Objective-C compiler is in