https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84222
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic CC| |msebor at gcc dot gnu.org Known to work| |4.2.3 Summary|[[deprecated]] class |[6/7/8 Regression] |complains about internal |[[deprecated]] class |class usage |complains about internal | |class usage Known to fail| |4.3.4, 4.5.4, 4.8.3, 4.9.3, | |5.3.0, 6.2.0, 7.1.0, 8.0 --- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> --- Confirmed with the following simplified C++ 98 test case: $ cat pr84222.C && gcc -O2 -c -g -Wall pr84222.C struct __attribute__ ((deprecated)) C { C() {} C(const C&); // emits a deprecation warning }; pr84222.C:3:15: warning: āCā is deprecated [-Wdeprecated-declarations] C(const C&); // emits a deprecation warning ^ It's a very old regression introduced in GCC 4.3. The likely candidate is r128691: PR c++/16370 * decl.c (grokdeclarator): Look through implicit TYPE_DECLs for deprecation warnings.