🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #50090

g++ bug in templates+virtual?

#50090
From: Ingres Database
Date: Mon, 22 Nov 1993 17:30
33 lines
1492 bytes
I have got error message from the compiler for:
--------------------------------------------------------------------------
class A { };

template <class T> 
class xyz  : virtual public A
{
public:
           xyz();
           xyz<T>(const xyz<T>& s);
           xyz<T>& operator=(const xyz<T>& c);
};

template <class T>
xyz<T>& xyz<T>::operator=(const xyz<T> &s)
  { }

template <class T>
xyz<T>::xyz(const xyz<T> &s)
  { }

main() { xyz<int> ixyz; }
--------------------------------------------------------------------------
g++ v2.5.3 compiled for sun-4 says:

test13rep.cc: In function `int main()':
test13rep.cc:10: inconsistent return types for method `xyz' in class `xyz<int>'

If I erase 'virtual' then it's OK. If I don't use template then it's OK.
Any ideas? Why this might be?

Thank you,
Vassili Leonov.
Technical Details
Message-ID: <2cqsvi$9mp@newsserv.cs.sunysb.edu>
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!gatech!udel!newsserv.cs.sunysb.edu!ingres

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,21b9496a8c19f6f5,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-11-22 10:04:54 PST
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!gatech!udel!newsserv.cs.sunysb.edu!ingres
From: ingres@cs.sunysb.edu (Ingres Database)
Newsgroups: gnu.gcc.help
Subject: g++ bug in templates+virtual?
Date: 22 Nov 1993 17:30:26 GMT
Organization: State University of New York at Stony Brook
Lines: 34
Message-ID: <2cqsvi$9mp@newsserv.cs.sunysb.edu>
NNTP-Posting-Host: sblapis4.cs.sunysb.edu
Keywords: bug, virtual, templates
X-Newsreader: TIN [version 1.2 PL1]