]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libstdc++/1773 (__cplusplus defined to 1, should be 199711L)
authorJason Merrill <jason@redhat.com>
Mon, 31 Oct 2011 19:34:26 +0000 (15:34 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 31 Oct 2011 19:34:26 +0000 (15:34 -0400)
PR libstdc++/1773
* init.c (cpp_init_builtins): Set __cplusplus for C++11.

From-SVN: r180708

libcpp/ChangeLog
libcpp/init.c

index 8013364e6be17982a58eb47172301acf9f7b199f..64ed468366911d621854512b6f95e0ad144f8f14 100644 (file)
@@ -1,5 +1,8 @@
 2011-10-31  Jason Merrill  <jason@redhat.com>
 
+       PR libstdc++/1773
+       * init.c (cpp_init_builtins): Set __cplusplus for C++11.
+
        PR c++/50920
        * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
        CLK_GNUCXX0X to CLK_GNUCXX11.
index bbaa8ae10c35bbec5e54646ae4e7b72fff152138..9101b34e086d24917af4d6acfe942226908f5b6e 100644 (file)
@@ -461,7 +461,13 @@ cpp_init_builtins (cpp_reader *pfile, int hosted)
     _cpp_define_builtin (pfile, "__STDC__ 1");
 
   if (CPP_OPTION (pfile, cplusplus))
-    _cpp_define_builtin (pfile, "__cplusplus 199711L");
+    {
+      if (CPP_OPTION (pfile, lang) == CLK_CXX11
+          || CPP_OPTION (pfile, lang) == CLK_GNUCXX11)
+       _cpp_define_builtin (pfile, "__cplusplus 201103L");
+      else
+       _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)