[Bug c/107947] __has_c_attribute incorrectly identifies attribute as supported
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Dec 1 14:51:48 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107947
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to WANG Xuerui from comment #0)
> I haven't bisected yet but can help doing so if necessary.
Bisection shows that it changed with r13-2976 which is the commit that added
support for the [[noreturn]] attribute. So it's totally correct that
__has_c_attribute starts to be non-zero then, because it started to be
supported then.
c: C2x noreturn attribute
C2x adds a standard [[noreturn]] attribute (which can also be spelt
[[_Noreturn]] for use with <stdnoreturn.h>), so allowing non-returning
functions to be declared in a manner compatible with C++; the
_Noreturn function specifier remains available but is marked
obsolescent.
More information about the Gcc-bugs
mailing list