bug with template declaration

Markus Grabner grabner@icg.tu-graz.ac.at
Fri Oct 20 04:01:00 GMT 2000


GCC version: 2.95.2

system type: i486-suse-linux

command line: gcc -save-temps x.cpp

compiler output:
x.cpp: In method `void c::f2<int>(int)':
x.cpp:3:   instantiated from here
x.cpp:4: Internal compiler error.
x.cpp:4: Please submit a full bug report.
x.cpp:4: See <URL: http://www.gnu.org/software/gcc/bugs.html > for
instructions.

preprocessed source file "x.ii" (also included as attachment):
# 1 "x.cpp"
struct c
{
  void f1() { f2(1); }
  template <class T> void f2(T x) {}
};

Putting the template line before the defintion of f1() resolves the
problem.

	Markus


-- 
Markus Grabner - Computer Graphics and Vision
Graz University of Technology, Inffeldgasse 16/II, 8010 Graz, Austria
Phone: +43/316/873-5041, Fax: +43/316/873-5050
Email: grabner@icg.tu-graz.ac.at, WWW:
http://www.icg.tu-graz.ac.at/~grabner
# 1 "x.cpp"
struct c
{
  void f1() { f2(1); }
  template <class T> void f2(T x) {}
};


More information about the Gcc-bugs mailing list