Add -std=c++1z flag for C++17 features.

llvm-svn: 211030
This commit is contained in:
Richard Smith
2014-06-16 15:16:56 +00:00
parent 9252057a07
commit dbd4d4c837
7 changed files with 51 additions and 7 deletions

View File

@@ -315,10 +315,13 @@ 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.
if (LangOpts.CPlusPlus1z)
Builder.defineMacro("__cplusplus", "201406L");
// C++1y [cpp.predefined]p1:
// The name __cplusplus is defined to the value 201402L when compiling a
// C++ translation unit.
if (LangOpts.CPlusPlus1y)
else if (LangOpts.CPlusPlus1y)
Builder.defineMacro("__cplusplus", "201402L");
// C++11 [cpp.predefined]p1:
// The name __cplusplus is defined to the value 201103L when compiling a