summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-08-03 17:01:05 +0000
committerDouglas Gregor <dgregor@apple.com>2011-08-03 17:01:05 +0000
commit73b855118823665ae3555e6f53406769b7ece22a (patch)
tree7ff161aa6dac8169d4ff831c69e2278780ee7326 /clang
parentda618420ee5b8850b41c9f1c16a370342ec5c5a3 (diff)
downloadbcm5719-llvm-73b855118823665ae3555e6f53406769b7ece22a.tar.gz
bcm5719-llvm-73b855118823665ae3555e6f53406769b7ece22a.zip
Comment the weird behavior of __has_feature(is_empty) and __has_feature(is_pod)
llvm-svn: 136788
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Lex/PPMacroExpansion.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp
index 7046c5f2fda..a4b6cc9db85 100644
--- a/clang/lib/Lex/PPMacroExpansion.cpp
+++ b/clang/lib/Lex/PPMacroExpansion.cpp
@@ -639,6 +639,10 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
.Case("is_base_of", LangOpts.CPlusPlus)
.Case("is_class", LangOpts.CPlusPlus)
.Case("is_convertible_to", LangOpts.CPlusPlus)
+ // __is_empty is available only if the horrible
+ // "struct __is_empty" parsing hack hasn't been needed in this
+ // translation unit. If it has, __is_empty reverts to a normal
+ // identifier and __has_feature(is_empty) evaluates false.
.Case("is_empty",
LangOpts.CPlusPlus &&
PP.getIdentifierInfo("__is_empty")->getTokenID()
@@ -646,6 +650,10 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
.Case("is_enum", LangOpts.CPlusPlus)
.Case("is_literal", LangOpts.CPlusPlus)
.Case("is_standard_layout", LangOpts.CPlusPlus)
+ // __is_pod is available only if the horrible
+ // "struct __is_pod" parsing hack hasn't been needed in this
+ // translation unit. If it has, __is_pod reverts to a normal
+ // identifier and __has_feature(is_pod) evaluates false.
.Case("is_pod",
LangOpts.CPlusPlus &&
PP.getIdentifierInfo("__is_pod")->getTokenID()
OpenPOWER on IntegriCloud