Endilll wrote:

> Looks like !__is_identifier(<revertible type trait name>) is used instead of 
> __has_builtin sometimes. With this patch, __is_identifier(<revertible type 
> trait name>) is true because there's no lparen after the name

Thank you, I'll make `__is_identifier` work.

> Apparantly __has_feature(__is_abstract) is also supposed to be true (...), 
> but that seems to be broken on main and not a new issue with this patch.

I can't make it work even on ancient version of Clang on Compiler Explorer, so 
I wonder if it ever worked.

> Also it doesn't seem ideal to not support things like:
>
> #define IS_CLASS __is_class
> static_assert(!IS_CLASS(void));
>
> Since these are supported by GCC and MSVC. Could you check again for an 
> lparen after a macro expansion?

I think this would require us to abandon the lex approach implemented here. But 
read on...

> In libc++: 
> https://github.com/llvm/llvm-project/commit/7f302f220e7b8727ed1bf8832dcc2d87b897e527
>  (Pretty easy fix to replace __has_keyword(__reference_binds_to_temporary) 
> with __has_builtin(__reference_binds_to_temporary) again though)

Goodness, I think this usage makes lex approach non-viable. Even if libc++ 
fixes that now, it has been deployed in system headers.

https://github.com/llvm/llvm-project/pull/96097
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to