Testcase: #include <stdlib.h> class base { public: base() {} private: int val_; };
class derived : public base { public: derived() {} }; bool x = true ? (derived*)0 : (base*)0; int main () { if (x) abort(); } -- Summary: [4.0/4.1/4.2 Regression] wrong code with ?: and derived class pointers Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25895