This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/46220] [4.3/4.4/4.5/4.6 Regression] Error: invalid covariant return type generated for incomplete class type and different qualifer
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 3 Mar 2011 20:52:02 +0000
- Subject: [Bug c++/46220] [4.3/4.4/4.5/4.6 Regression] Error: invalid covariant return type generated for incomplete class type and different qualifer
- Auto-submitted: auto-generated
- References: <bug-46220-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46220
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-03 20:52:00 UTC ---
(In reply to comment #4)
> Jason, is there a reason to disallow covariant returns where the return type
> only differs in cv-qualification of the class type?
>
> Could the requirement for a complete type be incorporated into the second
> bullet of p5, since it has to be complete for us to know it's an accessible
> base?
Seems reasonable to me. Or change "if the return type..." to "if the class in
the return type...". I note that EDG accepts the testcase.
> Why does the third bullet of p5 talk about the cv-qualification of pointers and
> references, when top-level cv-quals in return types are ignored, and references
> have no cv-quals? Is this an artefact of ARM-era C++?
Top-level cv-quals are not ignored in return types, only in parameter types.
> Am I misreading the wording, or should I ask Mike to open an issue?
I think an issue to clarify this would be appropriate. I'll go ahead and fix
the compiler.