https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125401
Bug ID: 125401
Summary: [[deprecated]] is misparsed after ctor name
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: aoliva at gcc dot gnu.org
Target Milestone: ---
// { dg-do compile }
struct T {
T [[deprecated]] () {}
};
T v; // { dg-warning "deprecated" }
yields:
t.cc:3:21: error: expected unqualified-id before ‘)’ token
I guess upon finding the attribute, we resolve T to a type-specifier, rather
than to a declarator-id, even though it could still be either one, and needs to
be resolved later.