This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Virtual function override differing by return type (bug?)
- To: andrew dot birkett at voxar dot com, gcc-bugs at gcc dot gnu dot org
- Subject: Re: Virtual function override differing by return type (bug?)
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Tue, 18 Jan 2000 23:49:22 +0100
- References: <200001181826.KAA05460@kankakee.wrs.com>
> > The following code compiles without complaint under gcc 2.95.2
>
> As it should, it is valid code.
To give a more formal reply: The feature is called "covariant return
types", and it is part of Standard C++. For some users, the missing
support for it in VC++ is one of the more serious limitations in that
compiler.
Not that g++ is perfect in that area; there are also cases of
covariant return types that g++ rejects.
Regards,
Martin