🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1492

undeclared member functions in templates

#1492
From: Nils McCarthy
Date: Mon, 28 Dec 1992 05:54
35 lines
2150 bytes
Under gcc2.3.3, mips-dec-ultrix4.2, the following code gives a
rather cryptic error message. i certainly didn't know i had
a member function named __vc.

template<class T> class foo {
};

template<class T> void foo<T>::operator []()
{
}

int main()
{
  foo<int> bar;
  return 0;
}

make testing
gcc -x c++ -v -g -Wall -I/u/hopper/local/include    testing.cc   -o testing
Reading specs from /usr/local/lib/gcc-lib/mips-dec-ultrix4.2/2.3.3/specs
gcc version 2.3.3
 /usr/local/lib/gcc-lib/mips-dec-ultrix4.2/2.3.3/cpp -lang-c++ -v -I/u/hopper/local/include -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__ANSI_COMPAT -DMIPSEL -DR3000 -DSYSTYPE_BSD -D_SYSTYPE_BSD -Dbsd4_2 -Dhost_mips -Dmips -Dultrix -Dunix -D__ANSI_COMPAT -D__MIPSEL__ -D__R3000__ -D__SYSTYPE_BSD__ -D___SYSTYPE_BSD__ -D__bsd4_2__ -D__host_mips__ -D__mips__ -D__ultrix__ -D__unix__ -D__ANSI_COMPAT -D__MIPSEL -D__R3000 -D__SYSTYPE_BSD -D___SYSTYPE_BSD -D__bsd4_2 -D__host_mips -D__mips -D__ultrix -D__unix 

-g -Wall -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C__ -D__LANGUAGE_C -DLANGUAGE_C testing.cc /usr/tmp/cca12299.i
GNU CPP version 2.3.3 [AL 1.1, MM 33] DECstation running ultrix
 /usr/local/lib/gcc-lib/mips-dec-ultrix4.2/2.3.3/cc1plus /usr/tmp/cca12299.i -quiet -dumpbase testing.cc -g -Wall -version -o /usr/tmp/cca12299.s
GNU C++ version 2.3.3 [AL 1.1, MM 33] DECstation running ultrix compiled by GNU C version 2.3.3.
testing.cc: In function `int  main ()':
testing.cc:2: method `__vc' not found in class `foo<int>'
testing.cc:2: warning: unused variable `bar'
make: *** [testing] Error 1

Compilation exited abnormally with code 1 at Mon Dec 28 12:51:02

-nils
Technical Details
Message-ID: <9212281954.AA12311@PC2.pc.maricopa.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!spool.mu.edu!wupost!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!pc2.pc.maricopa.edu!nils

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!spool.mu.edu!wupost!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!pc2.pc.maricopa.edu!nils
From: nils@pc2.pc.maricopa.edu (Nils McCarthy)
Newsgroups: gnu.gcc.bug
Subject: undeclared member functions in templates
Message-ID: <9212281954.AA12311@PC2.pc.maricopa.edu>
Date: 28 Dec 92 05:54:39 GMT
Sender: gnulists@ai.mit.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 33
Approved: bug-gcc@prep.ai.mit.edu