This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

bug with template declaration


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) {}
};

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]