g++ internal compiler error, concerning templates

Gerd Sussner Gerd.Sussner@informatik.uni-erlangen.de
Mon Feb 14 01:06:00 GMT 2000


hi folks,

i discovered a bug in g++ concerning templates. i reduced my code to
the minimum amount to cause g++ exit with internal compiler error.
the bug occurs in gcc-2.95.2 and also in the latest snapshot-release
egcs-20000207. it occurs on i386-linux and irix-6.5 systems, other
systems were not tested since i don't have access. furthermore, i didn't
find any former announcement of this kind of a bug.

in my opinion, the code is absolutely correct c++-code, so the bug should
not rely on false code. btw., the mips- and the sun-compiler produces the
expected result - ok, i have to admit, that this also can be a bug of the
other compiler, so if you find out, that this is not correct c++-code,
please tell me.

error-message:
g++-bug.C: In instantiation of `C<int>::CB':
g++-bug.C:59:   instantiated from here
g++-bug.C:41: Internal compiler error.
g++-bug.C:41: Please submit a full bug report.
g++-bug.C:41: See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport >
for instructions.


error-description:
i included a test-program which contains three template classes.
class A is a base class, containing two member classes, one regular member
class and one template member class.

the second class B is just a regular class, which takes as second template
argument a member class of A.

class C contains two regular member classes, both derived from class B.
one with class A::AA as second template argument for B and one with
A::AB<int>.

the strange thing is, if class A has only one template parameter,
everything is ok. look also for the comments in bug-g++.C

i hope, i can help with this bug-report to improve g++.

gerd sussner

<sussner@informatik.uni-erlangen.de>



More information about the Gcc-bugs mailing list