summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorFaisal Vali <faisalv@yahoo.com>2017-07-16 00:23:04 +0000
committerFaisal Vali <faisalv@yahoo.com>2017-07-16 00:23:04 +0000
commit5f475b989c8b2ffd35dccbdc77a64ac36601e727 (patch)
tree2c97660410ccd7c02d4e6e75c0b08106fbba6752 /clang/lib/Frontend/InitPreprocessor.cpp
parent50648af623295e526b2943cc9ce7aa2b3db5a6ce (diff)
downloadbcm5719-llvm-5f475b989c8b2ffd35dccbdc77a64ac36601e727.tar.gz
bcm5719-llvm-5f475b989c8b2ffd35dccbdc77a64ac36601e727.zip
[c++2a] Add option -std=c++2a to enable support for potential/transitional C++2a features
- as usual C++2a implies all the C++'s that came before it. Thank you Aaron for the feedback here: https://reviews.llvm.org/D35454 llvm-svn: 308118
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 71420df0002..64128dfdf53 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -374,10 +374,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++20.
+ if (LangOpts.CPlusPlus2a)
+ Builder.defineMacro("__cplusplus", "201707L");
// C++17 [cpp.predefined]p1:
// The name __cplusplus is defined to the value 201703L when compiling a
// C++ translation unit.
- if (LangOpts.CPlusPlus1z)
+ else if (LangOpts.CPlusPlus1z)
Builder.defineMacro("__cplusplus", "201703L");
// C++1y [cpp.predefined]p1:
// The name __cplusplus is defined to the value 201402L when compiling a
OpenPOWER on IntegriCloud