OSDN Git Service

PR libstdc++/1773
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 31 Oct 2011 19:34:26 +0000 (19:34 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 31 Oct 2011 19:34:26 +0000 (19:34 +0000)
* init.c (cpp_init_builtins): Set __cplusplus for C++11.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180708 138bc75d-0d04-0410-961f-82ee72b054a4

libcpp/ChangeLog
libcpp/init.c

index 8013364..64ed468 100644 (file)
@@ -1,5 +1,8 @@
 2011-10-31  Jason Merrill  <jason@redhat.com>
 
 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.
        PR c++/50920
        * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
        CLK_GNUCXX0X to CLK_GNUCXX11.
index bbaa8ae..9101b34 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, "__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)
   else if (CPP_OPTION (pfile, lang) == CLK_ASM)
     _cpp_define_builtin (pfile, "__ASSEMBLER__ 1");
   else if (CPP_OPTION (pfile, lang) == CLK_STDC94)