summaryrefslogtreecommitdiff
path: root/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-07-19 07:02:30 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-07-19 07:02:30 +0000
commitde51d671486b6ac9a2ad9ee5fcfdb1a23cc59238 (patch)
tree17ff629bd1f00b82d8dbb66a022e2f59e218c3c2 /lib/Frontend/InitPreprocessor.cpp
parent8746d127c04f5bbaf6c6e88cef8606ca5a6a54e9 (diff)
Notes
Diffstat (limited to 'lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--lib/Frontend/InitPreprocessor.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp
index 71420df00025e..64128dfdf534f 100644
--- a/lib/Frontend/InitPreprocessor.cpp
+++ b/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