Description of problem: ----- $ cat foo.cc #include <cassert> struct A { bool f(); void g(); void *x; }; bool A::f() { return x!=0; } void A::g() { assert(f()); extern volatile int y; y = 0; } $ g++ -O3 -Wunreachable-code -c foo.cc foo.cc: In member function `void A::g()': foo.cc:22: warning: will never be executed ----- This warning is wrong; it happens also when using 'assert(f() || !f())' but not, with 'assert(true)' or 'assert(false)' where it would be right. Version-Release number of selected component (if applicable): gcc-c++-3.2.1-5
Fixed with gcc 3.2.3-20.