public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [C++ docs patch] PR 56544
@ 2013-06-08  8:57 Paolo Carlini
  2013-06-18 10:07 ` PING " Paolo Carlini
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Carlini @ 2013-06-08  8:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jason Merrill

[-- Attachment #1: Type: text/plain, Size: 401 bytes --]

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.

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

[-- Attachment #2: patch_56544 --]
[-- Type: text/plain, Size: 1197 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* PING [C++ docs patch] PR 56544
  2013-06-08  8:57 [C++ docs patch] PR 56544 Paolo Carlini
@ 2013-06-18 10:07 ` Paolo Carlini
  2013-06-19  9:04   ` Paolo Carlini
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Carlini @ 2013-06-18 10:07 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jason Merrill

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PING [C++ docs patch] PR 56544
  2013-06-18 10:07 ` PING " Paolo Carlini
@ 2013-06-19  9:04   ` Paolo Carlini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Carlini @ 2013-06-19  9:04 UTC (permalink / raw)
  To: Paolo Carlini; +Cc: gcc-patches, Jason Merrill

[-- Attachment #1: Type: text/plain, Size: 131 bytes --]

... I have no committed this simple doc update. Also, a 4_8-branch 
version, attached below.

Thanks,
Paolo.

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

[-- Attachment #2: CL_56544 --]
[-- Type: text/plain, Size: 198 bytes --]

2013-06-19  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/56544
	* doc/cpp.texi [Standard Predefined Macros, __cplusplus]: Document
	that now in C++ the value is correct per the C++ standards.

[-- Attachment #3: patch_56544_48 --]
[-- Type: text/plain, Size: 1050 bytes --]

Index: doc/cpp.texi
===================================================================
--- doc/cpp.texi	(revision 200192)
+++ doc/cpp.texi	(working copy)
@@ -1926,11 +1926,9 @@ 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, or @code{201103L}, per the 2011 C++ standard.
 
 @item __OBJC__
 This macro is defined, with value 1, when the Objective-C compiler is in

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-06-19  9:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-08  8:57 [C++ docs patch] PR 56544 Paolo Carlini
2013-06-18 10:07 ` PING " Paolo Carlini
2013-06-19  9:04   ` Paolo Carlini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).