[cfe-dev] __has_attribute in system headers

Jonathan Sauer jonathan.sauer at gmx.de
Sat Feb 25 12:19:02 PST 2012


>> I got hit by this issue too. 
>> 
>> I tried to declare a cxx_noreturn macros (which is perfectly legal AFAIK), but it conflicted with clang  __has_feature() .
>> 
>> Having an alternate syntax for __has_xxx() special functions, or disabling macro evaluation in such context, would be really useful.
> 
> GCC's attributes have an '__attribute__' form to avoid this case (as identifiers beginning with '__' are reserved for the
> system and the compiler). Maybe clang should follow this example.

For those not reading cfe-commits: It now (r151445) does (cf. clang's language extension manual at
<http://clang.llvm.org/docs/LanguageExtensions.html#feature_check>).


Jonathan





More information about the cfe-dev mailing list