]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Diagnose attributes on class/enum declarations [PR110345]
authorJakub Jelinek <jakub@redhat.com>
Wed, 18 Dec 2024 10:54:57 +0000 (11:54 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 18 Dec 2024 10:54:57 +0000 (11:54 +0100)
commitd003a3862aeac72d0417cc41daafdf968bdb1839
treec105f9c789dc43156caf363e78c9237f22fd1526
parent49b142f2ef5d985dd6c4509d692ee4dfedfd4658
c++: Diagnose attributes on class/enum declarations [PR110345]

The following testcase shows another issue where we just ignored
attributes without telling user we did that.

If there are any declarators, the ignoring of the attribute
are diagnosed in grokdeclarator etc., but if there is none
(and we don't error such as on
int;
), the following patch emits diagnostics.

2024-12-18  Jakub Jelinek  <jakub@redhat.com>

PR c++/110345
* decl.cc (check_tag_decl): Diagnose std_attributes.

* g++.dg/cpp0x/gen-attrs-86.C: New test.
gcc/cp/decl.cc
gcc/testsuite/g++.dg/cpp0x/gen-attrs-86.C [new file with mode: 0644]