Update __cplusplus to match the value in the C++14 DIS preview (D3937).

llvm-svn: 202003
This commit is contained in:
Richard Smith
2014-02-24 01:35:45 +00:00
parent 8ab1691091
commit 51bacfd9c7
2 changed files with 7 additions and 5 deletions

View 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.