[PATCH] add __is_constructible to the list of features queryable by __has_feature
richard at metafoo.co.uk
Mon Mar 17 19:03:55 PDT 2014
I don't see any harm in extending the current list a little further, since
it doesn't seem like we've made any other decision yet. Please keep things
sorted alphabetically; otherwise patch LGTM.
On Mon, Mar 17, 2014 at 3:28 PM, Marshall Clow <mclow.lists at gmail.com>wrote:
> On Mar 17, 2014, at 2:53 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> I seem to recall someone suggesting that we move away from using
> __has_feature for these checks.
> If you mean the discussion between you, Aaron, and Alp - then yes, I
> recall it too.
> But it seemed to peter out w/o a resolution.
> I'm not wedded to this approach; but I would like to be able to tell if a
> compiler supports __is_constructible(Foo).
> I believe that the "current way" is to check using
> __has_feature(is_constructible), but I'm open to other methods.
> -- Marshall
> 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
>> 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 @@
>> // CHECK: int is_standard_layout();
>> +#if __has_feature(is_constructible)
>> +int is_constructible();
>> +// CHECK: int is_constructible();
>> #if __has_feature(is_trivially_copyable)
>> int is_trivially_copyable();
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-commits