[Bug c++/62232] New: -Wnon-virtual-dtor shouldn't warn on final classes
trippels at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Aug 22 13:47:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62232
Bug ID: 62232
Summary: -Wnon-virtual-dtor shouldn't warn on final classes
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: trippels at gcc dot gnu.org
Please consider:
markus@x4 ~ % cat destruct.ii
class base
{
protected:
~base () {}
virtual void foo (){};
};
class derive final : public base
{
};
markus@x4 ~ % clang++ -Wnon-virtual-dtor -c -std=c++11 destruct.ii
markus@x4 ~ % g++ -Wnon-virtual-dtor -c -std=c++11 destruct.ii
destruct.ii:7:7: warning: ‘class derive’ has virtual functions and accessible
non-virtual destructor [-Wnon-virtual-dtor]
class derive final : public base
^
We shouldn't warn in this case.
More information about the Gcc-bugs
mailing list