BUG
Martin v. Loewis
martin@loewis.home.cs.tu-berlin.de
Sat Apr 1 01:31:00 GMT 2000
> // I compile this file and I obtain:
> // deivadas.C:27: sorry, not implemented: adjusting pointers for covariant returns
> // The line is the unique // in code.
> // The problem is : NOT COMPILE AND IT SHOULD return ERROR OVERLOADING FUNCTION ...
> // OR anything shuch this.
Thanks for your bug report. Your code is really correct: D::Open()
really overrides D2D::Open. This is called "covariant return types",
and it means that the derived class can return a derived pointer from
the virtual function. As g++ explains, it does not support that
particular case, and it is therefore sorry.
Hope this helps,
Martin
More information about the Gcc-bugs
mailing list