🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1093

Re: template - const bug

#1093
From: Mike Stump
Date: Fri, 06 Nov 1992 08:45
33 lines
1373 bytes
This problem has been fixed, and should not exist in the next release of gcc.

Folks, please remember that g++ bugs should be reported to the bug-g++ list.

> From: jonas@beppe.ericsson.se (Jonas Nygren)
> Message-Id: <1992Aug5.061842.3278@ericsson.se>
> Organization: Ericsson Telecom, Stockholm, Sweden
> Date: Wed, 5 Aug 1992 06:18:42 GMT
> Apparently-To: gnu-gcc-bug@sunet.se
> To: bug-gcc@prep.ai.mit.edu

> Here follows a template bug related to const member functions. If
> 'const' is removed or the definition is kept within the class
> declaration everything works OK.

> template<class T> class X {
> public:
>   int f() const;
> };

> template<class T> int X<T>::f() const {
>   return 0;
> }

> main(){
>   X<int> x;
> }


> gcc 2.1 and 2.2.1 complains as follows:

> /u/jonas/z.cc: In function `int  main ()':
> /u/jonas/z.cc:5: template for method `f' doesn't match any in class `X<int>'
Technical Details
Message-ID: <9211060845.AA02236@cygnus.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!emory!wupost!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cygnus.com!mrs

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!emory!wupost!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cygnus.com!mrs
From: mrs@cygnus.com (Mike Stump)
Newsgroups: gnu.g++.bug
Subject: Re:  template - const bug
Message-ID: <9211060845.AA02236@cygnus.com>
Date: 6 Nov 92 08:45:25 GMT
Article-I.D.: cygnus.9211060845.AA02236
Sender: gnulists@ai.mit.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 33
Approved: bug-g++@prep.ai.mit.edu