Using g++3.4.3 (gcc version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)) to compile a testcase with covariant return types. In the testcase, the covariant function C::l() returns a null pointer, g++3.4.3 does the return value adjustment and returns a non-null return value ( which is incorrectly). Here is the steps to reproduce the problem and the execution result: >g++ t.C >a.out in C* C::l cp=0x8
-- Summary: Incorrect return value for covariant return function returning null ptr Product: gcc Version: 3.4.3 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: yanliu at ca dot ibm dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20747