]> granicus.if.org Git - clang/commitdiff
Update __cplusplus to match the value in the C++14 DIS preview (D3937).
authorRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 24 Feb 2014 01:35:45 +0000 (01:35 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 24 Feb 2014 01:35:45 +0000 (01:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202003 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/InitPreprocessor.cpp
test/Preprocessor/init.c

index f975c9f6955dc0c5e3801ea3052d3fbc1027c452..d95c254bbc11abfa40c0f4524c600b493fefa0c0 100644 (file)
@@ -315,9 +315,11 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
     else if (!LangOpts.GNUMode && LangOpts.Digraphs)
       Builder.defineMacro("__STDC_VERSION__", "199409L");
   } else {
-    // FIXME: Use the right value for __cplusplus for C++1y once one is chosen.
-    if (LangOpts.CPlusPlus1y)
-      Builder.defineMacro("__cplusplus", "201305L");
+    // C++1y [cpp.predefined]p1:
+    //   The name __cplusplus is defined to the value 201402L when compiling a
+    //   C++ translation unit.
+     if (LangOpts.CPlusPlus1y)
+      Builder.defineMacro("__cplusplus", "201402L");
     // C++11 [cpp.predefined]p1:
     //   The name __cplusplus is defined to the value 201103L when compiling a
     //   C++ translation unit.
index d42f18de4a302e638f044458b088da2736d4062b..13c0182752ea1e7c7aa4c45f10bb0cd66f0e7d34 100644 (file)
@@ -15,7 +15,7 @@
 // CXX1Y:#define __GXX_EXPERIMENTAL_CXX0X__ 1
 // CXX1Y:#define __GXX_RTTI 1
 // CXX1Y:#define __GXX_WEAK__ 1
-// CXX1Y:#define __cplusplus 201305L
+// CXX1Y:#define __cplusplus 201402L
 // CXX1Y:#define __private_extern__ extern
 //
 //
@@ -89,7 +89,7 @@
 //
 // GXX1Y:#define __GNUG__
 // GXX1Y:#define __GXX_WEAK__ 1
-// GXX1Y:#define __cplusplus 201305L
+// GXX1Y:#define __cplusplus 201402L
 // GXX1Y:#define __private_extern__ extern
 //
 //