From: Richard Smith Date: Mon, 20 Mar 2017 20:12:48 +0000 (+0000) Subject: Bump __cplusplus for C++17 to 201703L per the C++17 DIS. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65ecf3afb2faf3d0598a6c742b81e7adec6b101b;p=clang Bump __cplusplus for C++17 to 201703L per the C++17 DIS. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298299 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp index 749dd9b951..88be7732f5 100644 --- a/lib/Frontend/InitPreprocessor.cpp +++ b/lib/Frontend/InitPreprocessor.cpp @@ -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. diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c index f9f3b26218..14d487559a 100644 --- a/test/Preprocessor/init.c +++ b/test/Preprocessor/init.c @@ -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 // // @@ -115,7 +115,7 @@ // // GXX1Z:#define __GNUG__ {{.*}} // GXX1Z:#define __GXX_WEAK__ 1 -// GXX1Z:#define __cplusplus 201406L +// GXX1Z:#define __cplusplus 201703L // GXX1Z:#define __private_extern__ extern // //