🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Forward declaration of templates fail

#1102
From: Mike Stump
Date: Fri, 06 Nov 1992 08:43
47 lines
1999 bytes
This problem has been fixed, and should not exist in the next release
of gcc.

> Message-Id: <9208061950.AA01898@life.ai.mit.edu>
> Date: Thu, 6 Aug 92 15:50:30 EDT
> From: w2martin@watson.ibm.com
> To: bug-gcc@prep.ai.mit.edu

> I am using the following:
> IBM RS 6000 running AIX 3.2
> g++ I believe version gcc-2.2.2 (it knows about templates)

> ----------------------------------------------------------------------------
> The following program runs without any problems:
> //template<class T> int myfunc(T x);
> template<class T> int myfunc(T x) {
>   return 2;
> }

> int myfunc2(int x);
> int myfunc2(int x) {
>  return 2;
> }

> main() {
>  myfunc(3);
>  myfunc2(0);
> }
> ----------------------------------------------------------------------------

> Now uncomment the first line to create a forward declaration, I get the
> following problem:

> bart /u/w2martin/c : g++ g++test.C
> 0706-317 ERROR: Unresolved or undefined symbols detected:
>                  Symbols in error (followed by references) are
>                  dumped to the load map.
> .myfunc__Fi
> collect: /bin/ld returned 8 exit status

> ----------------------------------------------------------------------------

> What is wrong? The IBM xlC C++ compiler accepts the same code, but I want
> to use g++ since we have it at MIT.

> If you could help me, write to w2martin@watson.ibm.com OR to
>                                martins@athena.mit.edu
Technical Details
Message-ID: <9211060843.AA02187@cygnus.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!iggy.GW.Vitalink.COM!cs.widener.edu!umn.edu!The-Star.honeywell.com!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cygnus.com!mrs

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!iggy.GW.Vitalink.COM!cs.widener.edu!umn.edu!The-Star.honeywell.com!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cygnus.com!mrs
From: mrs@cygnus.com (Mike Stump)
Subject: Re:  Forward declaration of templates fail
Message-ID: <9211060843.AA02187@cygnus.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 6 Nov 1992 08:43:37 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 48