]> granicus.if.org Git - clang/commitdiff
Bump __cplusplus for C++17 to 201703L per the C++17 DIS.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 20 Mar 2017 20:12:48 +0000 (20:12 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 20 Mar 2017 20:12:48 +0000 (20:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298299 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 749dd9b951b1fdb9aad1c2a0ddb3cd0e5a1d89d4..88be7732f519ab16bc800d51cfbfdf549b9abbb6 100644 (file)
@@ -374,9 +374,11 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
     else if (!LangOpts.GNUMode && LangOpts.Digraphs)
       Builder.defineMacro("__STDC_VERSION__", "199409L");
   } else {
-    // FIXME: Use correct value for C++17.
+    // C++17 [cpp.predefined]p1:
+    //   The name __cplusplus is defined to the value 201703L when compiling a
+    //   C++ translation unit.
     if (LangOpts.CPlusPlus1z)
-      Builder.defineMacro("__cplusplus", "201406L");
+      Builder.defineMacro("__cplusplus", "201703L");
     // C++1y [cpp.predefined]p1:
     //   The name __cplusplus is defined to the value 201402L when compiling a
     //   C++ translation unit.
index f9f3b26218936d9defc60fbc3af173ecb5ae8fc2..14d487559a40b6404ae0cc52f52dab4ffb9b19a4 100644 (file)
@@ -15,7 +15,7 @@
 // CXX1Z:#define __GXX_EXPERIMENTAL_CXX0X__ 1
 // CXX1Z:#define __GXX_RTTI 1
 // CXX1Z:#define __GXX_WEAK__ 1
-// CXX1Z:#define __cplusplus 201406L
+// CXX1Z:#define __cplusplus 201703L
 // CXX1Z:#define __private_extern__ extern
 //
 //
 //
 // GXX1Z:#define __GNUG__ {{.*}}
 // GXX1Z:#define __GXX_WEAK__ 1
-// GXX1Z:#define __cplusplus 201406L
+// GXX1Z:#define __cplusplus 201703L
 // GXX1Z:#define __private_extern__ extern
 //
 //