<div dir="ltr">Done with r270583, I added a note in a comment to avoid this situation in the future.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 24, 2016 at 10:26 AM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><p dir="ltr">On 24 May 2016 10:15 a.m., "Richard Smith" <<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>> wrote:<br>
><br>
> As I recall, this was intentional. The supported way to check for these is has_builtin. The has_feature support is provided only for backwards compatibility.</p>
</span><p dir="ltr">See documentation here: <br>
<a href="http://clang.llvm.org/docs/LanguageExtensions.html#checks-for-type-trait-primitives" target="_blank">http://clang.llvm.org/docs/LanguageExtensions.html#checks-for-type-trait-primitives</a></p>
<p dir="ltr">These should be covered only by has_extension, not by has_feature.</p><div class="HOEnZb"><div class="h5">
<p dir="ltr">> On 24 May 2016 9:59 a.m., "David Majnemer via cfe-commits" <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br>
>><br>
>> Author: majnemer<br>
>> Date: Tue May 24 11:53:13 2016<br>
>> New Revision: 270580<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=270580&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=270580&view=rev</a><br>
>> Log:<br>
>> [Lex] Support more type-traits in __has_feature<br>
>><br>
>> It looks like we forgot to update the __has_feature support when we<br>
>> added some of the type traits.<br>
>><br>
>> Modified:<br>
>>     cfe/trunk/lib/Lex/PPMacroExpansion.cpp<br>
>>     cfe/trunk/test/Lexer/has_feature_type_traits.cpp<br>
>><br>
>> Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp<br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=270580&r1=270579&r2=270580&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=270580&r1=270579&r2=270580&view=diff</a><br>
>> ==============================================================================<br>
>> --- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)<br>
>> +++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Tue May 24 11:53:13 2016<br>
>> @@ -1191,8 +1191,10 @@ static bool HasFeature(const Preprocesso<br>
>>        .Case("has_nothrow_copy", LangOpts.CPlusPlus)<br>
>>        .Case("has_nothrow_constructor", LangOpts.CPlusPlus)<br>
>>        .Case("has_trivial_assign", LangOpts.CPlusPlus)<br>
>> +      .Case("has_trivial_move_assign", LangOpts.CPlusPlus)<br>
>>        .Case("has_trivial_copy", LangOpts.CPlusPlus)<br>
>>        .Case("has_trivial_constructor", LangOpts.CPlusPlus)<br>
>> +      .Case("has_trivial_move_constructor", LangOpts.CPlusPlus)<br>
>>        .Case("has_trivial_destructor", LangOpts.CPlusPlus)<br>
>>        .Case("has_virtual_destructor", LangOpts.CPlusPlus)<br>
>>        .Case("is_abstract", LangOpts.CPlusPlus)<br>
>> @@ -1201,14 +1203,21 @@ static bool HasFeature(const Preprocesso<br>
>>        .Case("is_class", LangOpts.CPlusPlus)<br>
>>        .Case("is_constructible", LangOpts.CPlusPlus)<br>
>>        .Case("is_convertible_to", LangOpts.CPlusPlus)<br>
>> +      .Case("is_destructible",<br>
>> +            LangOpts.CPlusPlus &&LangOpts.MicrosoftExt)<br>
>>        .Case("is_empty", LangOpts.CPlusPlus)<br>
>>        .Case("is_enum", LangOpts.CPlusPlus)<br>
>>        .Case("is_final", LangOpts.CPlusPlus)<br>
>>        .Case("is_literal", LangOpts.CPlusPlus)<br>
>> -      .Case("is_standard_layout", LangOpts.CPlusPlus)<br>
>> +      .Case("is_nothrow_assignable", LangOpts.CPlusPlus)<br>
>> +      .Case("is_nothrow_constructible", LangOpts.CPlusPlus)<br>
>> +      .Case("is_nothrow_destructible",<br>
>> +            LangOpts.CPlusPlus && LangOpts.MicrosoftExt)<br>
>>        .Case("is_pod", LangOpts.CPlusPlus)<br>
>>        .Case("is_polymorphic", LangOpts.CPlusPlus)<br>
>> -      .Case("is_sealed", LangOpts.MicrosoftExt)<br>
>> +      .Case("is_sealed",<br>
>> +            LangOpts.CPlusPlus && LangOpts.MicrosoftExt)<br>
>> +      .Case("is_standard_layout", LangOpts.CPlusPlus)<br>
>>        .Case("is_trivial", LangOpts.CPlusPlus)<br>
>>        .Case("is_trivially_assignable", LangOpts.CPlusPlus)<br>
>>        .Case("is_trivially_constructible", LangOpts.CPlusPlus)<br>
>><br>
>> Modified: cfe/trunk/test/Lexer/has_feature_type_traits.cpp<br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/has_feature_type_traits.cpp?rev=270580&r1=270579&r2=270580&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/has_feature_type_traits.cpp?rev=270580&r1=270579&r2=270580&view=diff</a><br>
>> ==============================================================================<br>
>> --- cfe/trunk/test/Lexer/has_feature_type_traits.cpp (original)<br>
>> +++ cfe/trunk/test/Lexer/has_feature_type_traits.cpp Tue May 24 11:53:13 2016<br>
>> @@ -20,6 +20,16 @@ int has_trivial_assign();<br>
>>  #endif<br>
>>  // CHECK: int has_trivial_assign();<br>
>><br>
>> +#if __has_feature(has_trivial_move_assign)<br>
>> +int has_trivial_move_assign();<br>
>> +#endif<br>
>> +// CHECK: int has_trivial_move_assign();<br>
>> +<br>
>> +#if __has_feature(has_trivial_move_constructor)<br>
>> +int has_trivial_move_constructor();<br>
>> +#endif<br>
>> +// CHECK: int has_trivial_move_constructor();<br>
>> +<br>
>>  #if __has_feature(has_trivial_copy)<br>
>>  int has_trivial_copy();<br>
>>  #endif<br>
>> @@ -105,6 +115,16 @@ int is_literal();<br>
>>  #endif<br>
>>  // CHECK: int is_literal();<br>
>><br>
>> +#if __has_feature(is_nothrow_assignable)<br>
>> +int is_nothrow_assignable();<br>
>> +#endif<br>
>> +// CHECK: int is_nothrow_assignable();<br>
>> +<br>
>> +#if __has_feature(is_nothrow_constructible)<br>
>> +int is_nothrow_constructible();<br>
>> +#endif<br>
>> +// CHECK: int is_nothrow_constructible();<br>
>> +<br>
>>  #if __has_feature(is_standard_layout)<br>
>>  int is_standard_layout();<br>
>>  #endif<br>
>><br>
>><br>
>> _______________________________________________<br>
>> cfe-commits mailing list<br>
>> <a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</p>
</div></div></blockquote></div><br></div>