]> granicus.if.org Git - clang/commitdiff
Turn off __has_feature(is_empty) and __has_feature(is_pod) if the
authorDouglas Gregor <dgregor@apple.com>
Sat, 30 Jul 2011 07:01:49 +0000 (07:01 +0000)
committerDouglas Gregor <dgregor@apple.com>
Sat, 30 Jul 2011 07:01:49 +0000 (07:01 +0000)
libstdc++ hack has reverted these type traits to keywords. Icky, but
fixes <rdar://problem/9836262>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136560 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/PPMacroExpansion.cpp
lib/Parse/ParseDeclCXX.cpp
test/SemaCXX/libstdcxx_is_pod_hack.cpp

index 5a88e5ff98e20820bc9ce38115379a4b2fcdbf38..58ba42e49a345567478bc7bd9a529421c5c48479 100644 (file)
@@ -639,11 +639,13 @@ 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)
-           .Case("is_empty", LangOpts.CPlusPlus)
+           .Case("is_empty", 
+                 LangOpts.CPlusPlus && II->getTokenID() != tok::identifier)
            .Case("is_enum", LangOpts.CPlusPlus)
            .Case("is_literal", LangOpts.CPlusPlus)
            .Case("is_standard_layout", LangOpts.CPlusPlus)
-           .Case("is_pod", LangOpts.CPlusPlus)
+           .Case("is_pod", 
+                 LangOpts.CPlusPlus && II->getTokenID() != tok::identifier)
            .Case("is_polymorphic", LangOpts.CPlusPlus)
            .Case("is_trivial", LangOpts.CPlusPlus)
            .Case("is_trivially_copyable", LangOpts.CPlusPlus)
index 0da743f2a90e5d72aadc398da684f101285b9623..344a433792ccbe4a63465f6f0f0c22ecc391aa7f 100644 (file)
@@ -901,7 +901,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
        Tok.is(tok::kw___is_signed) ||
        Tok.is(tok::kw___is_unsigned) ||
        Tok.is(tok::kw___is_void))) {
-    // GNU libstdc++ 4.2 and libc++ uaw certain intrinsic names as the
+    // GNU libstdc++ 4.2 and libc++ use certain intrinsic names as the
     // name of struct templates, but some are keywords in GCC >= 4.3
     // and Clang. Therefore, when we see the token sequence "struct
     // X", make X into a normal identifier rather than a keyword, to
index 3581c796ce916668fc4b3f1b28511f98083185ec..3ac233627ccb7b412081e990024fced23f8231c1 100644 (file)
@@ -27,3 +27,7 @@ struct test_is_signed {
 };
 
 bool check_signed = test_is_signed::__is_signed;
+
+#if __has_feature(is_pod)
+#  error __is_pod won't work now anyway
+#endif