diff options
author | Patrick Palka <ppalka@redhat.com> | 2022-11-06 11:09:26 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2022-11-06 11:09:26 -0500 |
commit | d0a492faa6478c99d325fa4a7ed2e5633cef7529 (patch) | |
tree | 733fcf33b077d090c956b85e6d13a6307bc1aebe /libjava/java/sql/SQLOutput.java | |
parent | 89d0a14a1fdf89d38d9db1156ffde8c1b276823c (diff) | |
download | gcc-d0a492faa6478c99d325fa4a7ed2e5633cef7529.zip gcc-d0a492faa6478c99d325fa4a7ed2e5633cef7529.tar.gz gcc-d0a492faa6478c99d325fa4a7ed2e5633cef7529.tar.bz2 |
c++: correct __has_attribute(init_priority)
Currently __has_attribute(init_priority) always returns true, even on
targets that don't actually support init priorities, and when using the
attribute on such targets we just get a hard error about them being
unsupported. This makes it impossible to conditionally use the attribute
by querying __has_attribute.
This patch fixes this by including init_priority in the attribute table
only if the target supports init priorities. Thus on such targets
__has_attribute(init_priority) will now return false and we'll treat it
as just another unrecognized attribute (e.g. using it gives a -Wattribute
warning instead of a hard error).
gcc/cp/ChangeLog:
* tree.cc (cxx_attribute_table): Include init_priority entry
only if SUPPORTS_INIT_PRIORITY.
(handle_init_priority_attribute): Add ATTRIBUTE_UNUSED. Assert
SUPPORTS_INIT_PRIORITY is true.
gcc/testsuite/ChangeLog:
* g++.dg/special/initpri3.C: New test.
Diffstat (limited to 'libjava/java/sql/SQLOutput.java')
0 files changed, 0 insertions, 0 deletions