* [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
2010-10-28 23:10 [Bug c++/46220] New: Error: invalid covariant return type generated for incomplete class type nathan.keynes at oracle dot com
@ 2010-10-28 23:16 ` pinskia at gcc dot gnu.org
2010-10-29 0:45 ` redi at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2010-10-28 23:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46220
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2010.10.28 23:16:36
Target Milestone|--- |4.3.6
Summary|Error: invalid covariant |[4.3/4.4/4.5/4.6
|return type generated for |Regression] Error: invalid
|incomplete class type and |covariant return type
|different qualifer |generated for incomplete
| |class type and different
| |qualifer
Ever Confirmed|0 |1
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2010-10-28 23:16:36 UTC ---
Confirmed, I don't see why this is a covariant return at all, the difference in
qualifier should not change anything.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [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
2010-10-28 23:10 [Bug c++/46220] New: Error: invalid covariant return type generated for incomplete class type nathan.keynes at oracle dot com
2010-10-28 23:16 ` [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 pinskia at gcc dot gnu.org
@ 2010-10-29 0:45 ` redi at gcc dot gnu.org
2010-10-29 0:51 ` redi at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2010-10-29 0:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46220
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-10-29 00:45:26 UTC ---
It certainly is a covariant return type, it meets the criteria in all three
bullet points of 10.3 [class.virtual] p5
^ permalink raw reply [flat|nested] 9+ messages in thread
* [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
2010-10-28 23:10 [Bug c++/46220] New: Error: invalid covariant return type generated for incomplete class type nathan.keynes at oracle dot com
2010-10-28 23:16 ` [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 pinskia at gcc dot gnu.org
2010-10-29 0:45 ` redi at gcc dot gnu.org
@ 2010-10-29 0:51 ` redi at gcc dot gnu.org
2010-10-29 1:16 ` redi at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2010-10-29 0:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46220
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-10-29 00:50:53 UTC ---
However p6 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.
In this case the class type in the return of Bar::getBaz is neither complete,
nor Bar.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [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
2010-10-28 23:10 [Bug c++/46220] New: Error: invalid covariant return type generated for incomplete class type nathan.keynes at oracle dot com
` (2 preceding siblings ...)
2010-10-29 0:51 ` redi at gcc dot gnu.org
@ 2010-10-29 1:16 ` redi at gcc dot gnu.org
2010-11-12 14:51 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2010-10-29 1:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46220
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-10-29 01:16:02 UTC ---
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?
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++?
Am I misreading the wording, or should I ask Mike to open an issue?
^ permalink raw reply [flat|nested] 9+ messages in thread
* [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
2010-10-28 23:10 [Bug c++/46220] New: Error: invalid covariant return type generated for incomplete class type nathan.keynes at oracle dot com
` (3 preceding siblings ...)
2010-10-29 1:16 ` redi at gcc dot gnu.org
@ 2010-11-12 14:51 ` rguenth at gcc dot gnu.org
2011-03-03 20:52 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-12 14:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46220
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 9+ messages in thread
* [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
2010-10-28 23:10 [Bug c++/46220] New: Error: invalid covariant return type generated for incomplete class type nathan.keynes at oracle dot com
` (4 preceding siblings ...)
2010-11-12 14:51 ` rguenth at gcc dot gnu.org
@ 2011-03-03 20:52 ` jason at gcc dot gnu.org
2011-03-04 15:18 ` jason at gcc dot gnu.org
2011-03-05 20:35 ` jason at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-03 20:52 UTC (permalink / raw)
To: gcc-bugs
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [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
2010-10-28 23:10 [Bug c++/46220] New: Error: invalid covariant return type generated for incomplete class type nathan.keynes at oracle dot com
` (5 preceding siblings ...)
2011-03-03 20:52 ` jason at gcc dot gnu.org
@ 2011-03-04 15:18 ` jason at gcc dot gnu.org
2011-03-05 20:35 ` jason at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-04 15:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46220
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-04 15:18:03 UTC ---
Author: jason
Date: Fri Mar 4 15:17:55 2011
New Revision: 170676
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170676
Log:
PR c++/46220
* search.c (check_final_overrider): Allow pointer to same incomplete
class type with different cv-quals.
Added:
trunk/gcc/testsuite/g++.dg/inherit/covariant19.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/search.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 9+ messages in thread
* [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
2010-10-28 23:10 [Bug c++/46220] New: Error: invalid covariant return type generated for incomplete class type nathan.keynes at oracle dot com
` (6 preceding siblings ...)
2011-03-04 15:18 ` jason at gcc dot gnu.org
@ 2011-03-05 20:35 ` jason at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-05 20:35 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46220
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|4.3.6 |4.6.0
--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-05 20:35:35 UTC ---
Fixed for 4.6. I'm somewhat reluctant to apply the patch to earlier releases,
since G++ was following the letter of the standard already, but am willing to
reconsider if someone really wants it in an earlier release.
^ permalink raw reply [flat|nested] 9+ messages in thread