https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116016

--- Comment #34 from qinzhao at gcc dot gnu.org ---
(In reply to Bill Wendling from comment #33)
> 
> If we had a way of testing for an attribute, we could avoid the need to
> return ( void *)0 when the '__builtin_get' can't find the attribute:
> 
>   __builtin_has_attr (ptr, attr_name);

GCC currently supports such builtin already:
https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fhas_005fattribute

Built-in Function: bool __builtin_has_attribute (type-or-expression, attribute)

Reply via email to