[PATCH] add __is_constructible to the list of features queryable by __has_feature

Marshall Clow mclow.lists at gmail.com
Mon Mar 17 13:36:01 PDT 2014


Note: Clang already implements “__is_constructible” - this just makes it checkable.
With this check I can use it in libc++.

— Marshall


Index: lib/Lex/PPMacroExpansion.cpp
===================================================================
--- lib/Lex/PPMacroExpansion.cpp        (revision 204039)
+++ lib/Lex/PPMacroExpansion.cpp        (working copy)
@@ -989,6 +989,7 @@
            .Case("is_sealed", LangOpts.MicrosoftExt)
            .Case("is_trivial", LangOpts.CPlusPlus)
            .Case("is_trivially_assignable", LangOpts.CPlusPlus)
+           .Case("is_constructible", LangOpts.CPlusPlus)
            .Case("is_trivially_constructible", LangOpts.CPlusPlus)
            .Case("is_trivially_copyable", LangOpts.CPlusPlus)
            .Case("is_union", LangOpts.CPlusPlus)
Index: test/Lexer/has_feature_type_traits.cpp
===================================================================
--- test/Lexer/has_feature_type_traits.cpp      (revision 204039)
+++ test/Lexer/has_feature_type_traits.cpp      (working copy)
@@ -100,6 +100,11 @@
 #endif
 // CHECK: int is_standard_layout();
 
+#if __has_feature(is_constructible)
+int is_constructible();
+#endif
+// CHECK: int is_constructible();
+
 #if __has_feature(is_trivially_copyable)
 int is_trivially_copyable();
 #endif





More information about the cfe-commits mailing list