[Bug c++/40997] Wrong address returned in covariant return
jwakely dot gcc at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Aug 7 12:42:00 GMT 2009
------- Comment #4 from jwakely dot gcc at gmail dot com 2009-08-07 12:42 -------
Ah, [class.virtual] paragraph 5 says:
If the return type of D::f differs from the return type of B::f, the class type
in the return type of D::f shall be complete at the point of declaration of
D::f or shall be the class type D.
The class Bart is not complete at the point of declaration of
Bart::InnerBart::getOuter(), which might explain why the pointer adjustment
does not happen.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40997
More information about the Gcc-bugs
mailing list