diff mbox

[libcpp] Correctly define __cplusplus (PR libstdc++-v3/1773)

Message ID ydd39gy69nu.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Aug. 18, 2011, 3:07 p.m. UTC
Jason,

> On 08/09/2011 09:14 AM, Marc Glisse wrote:
>> I don't think we should define the C++ 2011 value yet. In my opinion, we
>> should wait until:
>> 1) the standard is official
>> 2) gcc implements most of it: people will want to use __cplusplus as a
>> test to know if they can use C++0X features, not if the compiler does
>> some effort to implement half of them.
>
> I'm of two minds about this, but I see that clang and edg still use 199711L
> in C++0x mode, so let's stick with that for now.

with the prerequisite patches now installed, here's the reworked version
of the final patch.

Tested as described for the rest, ok for mainline?

	Rainer


2011-03-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR libstdc++/1773
	* init.c (cpp_init_builtins): Define __cplusplus 19971L.

Comments

Tom Tromey Aug. 18, 2011, 5:18 p.m. UTC | #1
>>>>> "Rainer" == Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

Jason> I'm of two minds about this, but I see that clang and edg still
Jason> use 199711L in C++0x mode, so let's stick with that for now.

Rainer> with the prerequisite patches now installed, here's the reworked version
Rainer> of the final patch.

Rainer> Tested as described for the rest, ok for mainline?

Ok.

Tom
diff mbox

Patch

# HG changeset patch
# Parent 1751547561d4c2f04c27d9507fb5cd679c6b3eb3
Properly define __cplusplus (PR libstdc++-v3/1773)

diff --git a/libcpp/init.c b/libcpp/init.c
--- a/libcpp/init.c
+++ b/libcpp/init.c
@@ -453,7 +453,7 @@  cpp_init_builtins (cpp_reader *pfile, in
     _cpp_define_builtin (pfile, "__STDC__ 1");
 
   if (CPP_OPTION (pfile, cplusplus))
-    _cpp_define_builtin (pfile, "__cplusplus 1");
+    _cpp_define_builtin (pfile, "__cplusplus 199711L");
   else if (CPP_OPTION (pfile, lang) == CLK_ASM)
     _cpp_define_builtin (pfile, "__ASSEMBLER__ 1");
   else if (CPP_OPTION (pfile, lang) == CLK_STDC94)