]> granicus.if.org Git - clang/commitdiff
Revert "[Lex] Support more type-traits in __has_feature"
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 24 May 2016 17:21:42 +0000 (17:21 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 24 May 2016 17:21:42 +0000 (17:21 +0000)
This reverts commit r270580.  Using __has_feature to test for
type-traits is deprecated.

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

lib/Lex/PPMacroExpansion.cpp
test/Lexer/has_feature_type_traits.cpp

index 130744fe2b13ce4dbe11b1b8e1cc90b7bc6ea51e..a4734a281248962d97a07885b8671203419bc70a 100644 (file)
@@ -1187,37 +1187,29 @@ static bool HasFeature(const Preprocessor &PP, StringRef Feature) {
       // FIXME: Should this be __has_feature or __has_extension?
       //.Case("raw_invocation_type", LangOpts.CPlusPlus)
       // Type traits
+      // N.B. Additional type traits should not be added to the following list.
+      // Instead, they should be detected by has_extension.
       .Case("has_nothrow_assign", LangOpts.CPlusPlus)
       .Case("has_nothrow_copy", LangOpts.CPlusPlus)
       .Case("has_nothrow_constructor", LangOpts.CPlusPlus)
       .Case("has_trivial_assign", LangOpts.CPlusPlus)
-      .Case("has_trivial_move_assign", LangOpts.CPlusPlus)
       .Case("has_trivial_copy", LangOpts.CPlusPlus)
       .Case("has_trivial_constructor", LangOpts.CPlusPlus)
-      .Case("has_trivial_move_constructor", LangOpts.CPlusPlus)
       .Case("has_trivial_destructor", LangOpts.CPlusPlus)
       .Case("has_virtual_destructor", LangOpts.CPlusPlus)
       .Case("is_abstract", LangOpts.CPlusPlus)
-      .Case("is_assignable", LangOpts.CPlusPlus)
       .Case("is_base_of", LangOpts.CPlusPlus)
       .Case("is_class", LangOpts.CPlusPlus)
       .Case("is_constructible", LangOpts.CPlusPlus)
       .Case("is_convertible_to", LangOpts.CPlusPlus)
-      .Case("is_destructible",
-            LangOpts.CPlusPlus &&LangOpts.MicrosoftExt)
       .Case("is_empty", LangOpts.CPlusPlus)
       .Case("is_enum", LangOpts.CPlusPlus)
       .Case("is_final", LangOpts.CPlusPlus)
       .Case("is_literal", LangOpts.CPlusPlus)
-      .Case("is_nothrow_assignable", LangOpts.CPlusPlus)
-      .Case("is_nothrow_constructible", LangOpts.CPlusPlus)
-      .Case("is_nothrow_destructible",
-            LangOpts.CPlusPlus && LangOpts.MicrosoftExt)
+      .Case("is_standard_layout", LangOpts.CPlusPlus)
       .Case("is_pod", LangOpts.CPlusPlus)
       .Case("is_polymorphic", LangOpts.CPlusPlus)
-      .Case("is_sealed",
-            LangOpts.CPlusPlus && LangOpts.MicrosoftExt)
-      .Case("is_standard_layout", LangOpts.CPlusPlus)
+      .Case("is_sealed", LangOpts.CPlusPlus && LangOpts.MicrosoftExt)
       .Case("is_trivial", LangOpts.CPlusPlus)
       .Case("is_trivially_assignable", LangOpts.CPlusPlus)
       .Case("is_trivially_constructible", LangOpts.CPlusPlus)
index 743d2e24ab0a0ff1c3e6e460e84397c93248ec16..f772d6d18452a9474cd47f77d221f33e95e2828d 100644 (file)
@@ -20,16 +20,6 @@ int has_trivial_assign();
 #endif
 // CHECK: int has_trivial_assign();
 
-#if __has_feature(has_trivial_move_assign)
-int has_trivial_move_assign();
-#endif
-// CHECK: int has_trivial_move_assign();
-
-#if __has_feature(has_trivial_move_constructor)
-int has_trivial_move_constructor();
-#endif
-// CHECK: int has_trivial_move_constructor();
-
 #if __has_feature(has_trivial_copy)
 int has_trivial_copy();
 #endif
@@ -55,11 +45,6 @@ int is_abstract();
 #endif
 // CHECK: int is_abstract();
 
-#if __has_feature(is_assignable)
-int is_assignable();
-#endif
-// CHECK: int is_assignable();
-
 #if __has_feature(is_base_of)
 int is_base_of();
 #endif
@@ -115,16 +100,6 @@ int is_literal();
 #endif
 // CHECK: int is_literal();
 
-#if __has_feature(is_nothrow_assignable)
-int is_nothrow_assignable();
-#endif
-// CHECK: int is_nothrow_assignable();
-
-#if __has_feature(is_nothrow_constructible)
-int is_nothrow_constructible();
-#endif
-// CHECK: int is_nothrow_constructible();
-
 #if __has_feature(is_standard_layout)
 int is_standard_layout();
 #endif