From: Richard Smith Date: Mon, 24 Feb 2014 01:35:45 +0000 (+0000) Subject: Update __cplusplus to match the value in the C++14 DIS preview (D3937). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ef725a70d30d805f109a55c376b78f6594862210;p=clang Update __cplusplus to match the value in the C++14 DIS preview (D3937). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202003 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp index f975c9f695..d95c254bbc 100644 --- a/lib/Frontend/InitPreprocessor.cpp +++ b/lib/Frontend/InitPreprocessor.cpp @@ -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. diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c index d42f18de4a..13c0182752 100644 --- a/test/Preprocessor/init.c +++ b/test/Preprocessor/init.c @@ -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 // //