This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/84222] [6/7/8 Regression] [[deprecated]] class complains about internal class usage
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 06 Feb 2018 16:56:18 +0000
- Subject: [Bug c++/84222] [6/7/8 Regression] [[deprecated]] class complains about internal class usage
- Auto-submitted: auto-generated
- References: <bug-84222-4@http.gcc.gnu.org/bugzilla/>
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.