[Bug c++/13830] New: Invalid covariant type for identical type.
mattyt-bugzilla at tpg dot com dot au
gcc-bugzilla@gcc.gnu.org
Fri Jan 23 12:04:00 GMT 2004
The code below:
template < class TP >
class A {
public:
friend class X;
typedef X * XP;
class X {};
virtual XP method();
};
template < class TP >
class B : public A< TP > {
public:
virtual typename A< TP >::XP method();
};
int main() {
B<int> a;
}
gives the error in 3.4:
restor5.cc: In instantiation of `B<int>':
restor5.cc:24: instantiated from here
restor5.cc:19: error: invalid covariant return type for `typename A<TP>::XP
B<TP>::method() [with TP = int]'
restor5.cc:11: error: overriding `X* A<TP>::method() [with TP = int]'
as best as I can tell, the type is identical and so it should compile.
--
Summary: Invalid covariant type for identical type.
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mattyt-bugzilla at tpg dot com dot au
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13830
More information about the Gcc-bugs
mailing list