🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #254

templates and friends

#254
From: Jonas Nygren
Date: Tue, 04 Aug 1992 07:32
33 lines
1021 bytes
Below follows an example where gcc fails to generate a function from a template.
I believe this to be a bug but my understanding of templates is perhaps lacking.

/jonas

example ---




template<class T> int f(T &t) { return 0; }

int f(int &i) { return 0; }

template<class T> class A {
  int fi;
public:
  friend int f(A &a);
};

template<class T> int f(A<T> &a) { return a.fi; }

main(){
  A<int> a;
  f(a);
  f(1);
}

gcc 2.1 on an HP reports missing symbol (code):

  f__FRt1A1Zi

end example ---
Technical Details
Message-ID: <1992Aug4.073204.2829@ericsson.se>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!uwm.edu!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!ericsson.SE!jonas

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!uwm.edu!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!ericsson.SE!jonas
From: jonas@ericsson.SE (Jonas Nygren)
Subject: templates and friends
Message-ID: <1992Aug4.073204.2829@ericsson.se>
Followup-To: gnu.gcc.bug
Sender: gnulists@ai.mit.edu
Reply-To: jonas@beppe.ericsson.se
Organization: Ericsson Telecom AB
Distribution: gnu
Date: Tue, 4 Aug 1992 07:32:04 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 36