This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81513] __has_cpp_attribute returns non-zero in C++03 mode, but attributes don't work
- From: "schwab at linux-m68k dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 24 Jul 2017 12:01:45 +0000
- Subject: [Bug c++/81513] __has_cpp_attribute returns non-zero in C++03 mode, but attributes don't work
- Auto-submitted: auto-generated
- References: <bug-81513-4@http.gcc.gnu.org/bugzilla/>
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.