https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66996
Bug ID: 66996 Summary: [6 Regression] defined but not used [-Wunused-function] Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com Target Milestone: --- [hjl@gnu-6 bin]$ cat x.cc namespace { class Foo { public: ~Foo (); }; Foo::~Foo () { } } [hjl@gnu-6 bin]$ ./g++ -S -Wall x.cc -O2 x.cc:10:1: warning: ‘{anonymous}::Foo::~Foo()’ defined but not used [-Wunused-function] Foo::~Foo () ^ [hjl@gnu-6 bin]$