This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
bug with template declaration
- To: gcc-bugs at gcc dot gnu dot org
- Subject: bug with template declaration
- From: Markus Grabner <grabner at icg dot tu-graz dot ac dot at>
- Date: Fri, 20 Oct 2000 13:00:33 +0200
- Organization: Computer Graphics and Vision, Graz University of Technology
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) {}
};