https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96620
Bug ID: 96620
Summary: bogus -Wdeprecated-declarations on attribute
deprecated immediately preceding parameter name
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: msebor at gcc dot gnu.org
Target Milestone: ---
The C++ front end (but not the C front end) issues a warning for the
declaration of the function argument in f1(). The C front end also doesn't
warn for this use case, and neither do Clang or ICC, suggesting the G++ rules
should be adjusted to match.
$ cat t.c && gcc -O2 -S -Wall -Wextra -xc++ t.c
#define DEPRECATED __attribute__ ((deprecated))
void f0 ( int * p DEPRECATED);
void f1 ( int * DEPRECATED p );
void f2 ( int DEPRECATED * p );
void f3 (DEPRECATED int * p );
t.c:4:61: warning: type is deprecated [-Wdeprecated-declarations]
4 | void f1 ( int * DEPRECATED p );
| ^