bug report (template functions)
Victor K. Chu
victor@mechatro2.ME.Berkeley.EDU
Mon Oct 26 21:03:00 GMT 1998
Hi,
I got an internal compiler error when I compiled
the appended C++ program on Linux 2.0.35 with
gcc version egcs-2.90.29 980515 (egcs-1.0.3 release).
Victor
#---------------
# Error message
#---------------
% g++ -g -Wall test.cpp
test.cpp: In method `int Test::f2<int>(int)':
test.cpp:16: Internal compiler error.
test.cpp:16: Please submit a full bug report to `egcs-bugs@cygnus.com'.
#---------------
# C++ Code
#---------------
#include <iostream.h>
class Test
{
public:
template <class T>
f1(T t)
{
cout << t << endl;
}
template <class T>
f2(T t)
{
f1(t);
}
};
int main()
{
Test t;
t.f2(123);
return 0;
}
More information about the Gcc-bugs
mailing list