[PATCH] add __is_constructible to the list of features queryable by __has_feature
Richard Smith
richard at metafoo.co.uk
Mon Mar 17 14:53:20 PDT 2014
I seem to recall someone suggesting that we move away from using
__has_feature for these checks.
On Mon, Mar 17, 2014 at 1:36 PM, Marshall Clow <mclow.lists at gmail.com>wrote:
> 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
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140317/da24b97b/attachment.html>
More information about the cfe-commits
mailing list