]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Parse and ignore attributes on base specifiers [PR110345]
authorJakub Jelinek <jakub@redhat.com>
Tue, 20 Aug 2024 20:15:03 +0000 (22:15 +0200)
committerJakub Jelinek <jakub@redhat.com>
Tue, 20 Aug 2024 20:15:03 +0000 (22:15 +0200)
commit1db5ca04da365ac57f7d788a85055edcf13da708
treee69c16a5af8ea60dbaf2f5d5a85f28f435adcac1
parent3676816caa510de226b357be1c68cf798da63576
c++: Parse and ignore attributes on base specifiers [PR110345]

For C++ 26 P2552R3 I went through all the spots (except modules) where
attribute-specifier-seq appears in the grammar and tried to construct
a testcase in all those spots, for now for [[deprecated]] attribute.

This is the third issue I found.

https://eel.is/c++draft/class.derived#general-1 has attribute-specifier-seq
at the start of base-specifier.  The following patch parses it there and
warns about those.

2024-08-20  Jakub Jelinek  <jakub@redhat.com>

PR c++/110345
* parser.cc (cp_parser_base_specifier): Parse standard attributes
at the start and emit a warning if there are any non-ignored ones.

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