summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-05-07 19:32:56 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-05-07 19:32:56 +0000
commit0a715429b9833f956e022099d5da64ff719df5ff (patch)
tree9ca6cc2b2dc3e9f3a4de9131df10e5cb4cfb3a5a /clang/lib/Frontend/InitPreprocessor.cpp
parente9ea0da82e0db315e62fe3b3d5e3580d3669d341 (diff)
downloadbcm5719-llvm-0a715429b9833f956e022099d5da64ff719df5ff.tar.gz
bcm5719-llvm-0a715429b9833f956e022099d5da64ff719df5ff.zip
C++1y: Update __cplusplus to temporary value 201305L to allow detection of provisional C++1y support.
Add __has_feature and __has_extension checks for C++1y features (based on the provisional names from the C++ features study group), and update documentation to match. llvm-svn: 181342
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 25cfac63233..dc3ab53eda0 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -302,12 +302,13 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
else if (!LangOpts.GNUMode && LangOpts.Digraphs)
Builder.defineMacro("__STDC_VERSION__", "199409L");
} else {
- // FIXME: LangOpts.CPlusPlus1y
-
+ // FIXME: Use the right value for __cplusplus for C++1y once one is chosen.
+ if (LangOpts.CPlusPlus1y)
+ Builder.defineMacro("__cplusplus", "201305L");
// C++11 [cpp.predefined]p1:
// The name __cplusplus is defined to the value 201103L when compiling a
// C++ translation unit.
- if (LangOpts.CPlusPlus11)
+ else if (LangOpts.CPlusPlus11)
Builder.defineMacro("__cplusplus", "201103L");
// C++03 [cpp.predefined]p1:
// The name __cplusplus is defined to the value 199711L when compiling a
OpenPOWER on IntegriCloud