This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/81513] __has_cpp_attribute returns non-zero in C++03 mode, but attributes don't work


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

--- Comment #4 from Andreas Schwab <schwab@linux-m68k.org> ---
> #if __cpp_attributes >= 200809 && defined(__has_cpp_attribute) \
>   && __has_cpp_attribute(maybe_unused)

This will result in a syntax error if the compiler does not support
__has_cpp_attribute.  You need to separate the check from the use of the macro.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]