https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122167
Bug ID: 122167
Summary: Redeclaring class as deprecated produces warning
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: kab at acm dot org
Target Milestone: ---
Compiling this:
-----
class Foo {};
class [[deprecated]] Foo;
-----
unexpectedly produces this warning:
warning: attribute declaration must precede definition [-Wignored-attributes]
Also warns for attribute((deprecated)).
[dcl.attr.deprecated] says a name or entity declared without a "deprecated"
attribute can be later redeclared with, and vice versa.