By adding a destructor to main class to example in the bug 21228 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21228) will produce incorrect warning about code that "will never be executed"
# g++ -Wunreachable-code gstest.cpp gstest.cpp: In constructor testString::testString(): gstest.cpp:24: warning: will never be executed gstest.cpp: In constructor testString::testString(): gstest.cpp:24: warning: will never be executed #cat gstest.cpp // #include <stdio.h> class testStringBase { public: ~testStringBase(); char *stringPtr; }; testStringBase::~testStringBase() { stringPtr = 0; } class testString : public testStringBase { public: testString(); }; testString::testString() { stringPtr = (char *) 9; } int main(int argc, char **argv) { testString s; // printf("s.stringPtr is %ld\n", (unsigned long) s.stringPtr); } -- Summary: -Wunreachable-code incorrect warning Product: gcc Version: 4.4.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jiri dot engelthaler at zat dot cz http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43344