[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#118781: g++: g++: internal compiler error using nested templates

Package: g++
Version: 2:2.95.4-8
Severity: normal


In trying to compile the following C++ program fragment using the command
	g++ -c foo.cc
I get the messages

	foo.cc:20: Internal compiler error.
	foo.cc:20: Please submit a full bug report.
	foo.cc:20: Internal compiler error:
	foo.cc:20: See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

I believe the syntax to be correct.  This is the simplest case I could find.

Program code follows.  Thanks,



template <class T>
class Generic
    T *obj;
    Generic(T &_obj) : obj(&_obj) { }

class Whatever
    template <class T>
    class Gen2 : public Generic<T>
	int x;
	Gen2() : Generic<T>(x) { }


-- System Information
Debian Release: testing/unstable
Kernel Version: Linux insight 2.4.9 #1 Thu Nov 1 23:29:21 EST 2001 i686 unknown

Versions of the packages g++ depends on:
ii  cpp            2.95.4-8       The GNU C preprocessor.
ii  g++-2.95       2.95.4-0.01042 The GNU C++ compiler.
ii  gcc-2.95       2.95.4-0.01042 The GNU C compiler.

Reply to: