[cfe-dev] __has_attribute in system headers

Jonathan Sauer jonathan.sauer at gmx.de
Thu Feb 23 08:07:05 PST 2012


Hello,

> 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.


Jonathan





More information about the cfe-dev mailing list