From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6818 invoked by alias); 23 Jan 2004 12:04:22 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 6811 invoked by uid 48); 23 Jan 2004 12:04:21 -0000 Date: Fri, 23 Jan 2004 12:04:00 -0000 From: "mattyt-bugzilla at tpg dot com dot au" To: gcc-bugs@gcc.gnu.org Message-ID: <20040123120418.13830.mattyt-bugzilla@tpg.com.au> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/13830] New: Invalid covariant type for identical type. X-Bugzilla-Reason: CC X-SW-Source: 2004-01/txt/msg02914.txt.bz2 List-Id: 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 a; } gives the error in 3.4: restor5.cc: In instantiation of `B': restor5.cc:24: instantiated from here restor5.cc:19: error: invalid covariant return type for `typename A::XP B::method() [with TP = int]' restor5.cc:11: error: overriding `X* A::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