Bug 162150
Summary: | Compiling app that uses QXml throws warnings | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Tim Niemueller <tim> |
Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED NOTABUG | QA Contact: | |
Severity: | low | Docs Contact: | |
Priority: | medium | ||
Version: | 4 | CC: | jason, than |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2005-08-25 22:44:18 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Tim Niemueller
2005-06-30 11:57:24 UTC
this looks like a bug of gcc4 to me. I.e. QXmlReader is an interface (i.e. has only pure virtual functions), and QXmlErrorHandler is a subclass of QXmlDefaultHandler which surely has a virtual destructor. It certainly matches the documentation: `-Wnon-virtual-dtor (C++ only)' Warn when a class appears to be polymorphic, thereby requiring a virtual destructor, yet it declares a non-virtual one. This warning is enabled by `-Wall'. A minimal testcase can be e.g.: struct C { virtual bool foo () = 0; }; struct D : public C { virtual bool foo () { return false; } virtual ~D (); }; Here, C is a class with virtual methods but without virtual destructor, so g++ warns. Plus I think the warning is useful even for pure virtual classes. Otherwise: struct C { virtual void foo () = 0; #ifdef VIRTUAL_DTOR virtual #endif ~C (); }; C::~C () {} struct D : public C { virtual void foo () {} virtual ~D (); }; D::~D () {} C *p = (C *) new D (); int main () { delete p; } having different behaviour depending on whether C::~C() is virtual or not would went unnoticed. Closed as "not a gcc bug" or "not a Qt bug"? |