This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/8561: Segfault when template class is not defined.
- From: bangerth at dealii dot org
- To: galen_sampson at yahoo dot com, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 13 Nov 2002 18:56:38 -0000
- Subject: Re: c++/8561: Segfault when template class is not defined.
- Reply-to: bangerth at dealii dot org, galen_sampson at yahoo dot com, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: Segfault when template class is not defined.
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Wed Nov 13 10:56:38 2002
State-Changed-Why:
Confirmed. This is probably the minimal example:
--------------------------
template <class T> class X {};
template <class T> class X<T>::Y : X<T>::Z {};
-----------------------------------
The code is of course bogus, since neither X::Y nor
X::Z are forward declared. The compiler ICEs, however,
also if X::Z _is_ forward declared, but X::Y is not.
These are the messages I get (gcc 2.95 -- the last one --
does a little better, but not much; however, the message
is significantly more helpful, so I raise the priority of
this report):
tmp/g> /home/bangerth/bin/gcc-3.3x-pre/bin/c++ -c x.ii
x.ii:2: internal compiler error: Speicherzugriffsfehler
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
tmp/g> /home/bangerth/bin/gcc-3.2.1-pre/bin/c++ -c x.ii
x.ii:2: internal error: Speicherzugriffsfehler
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
gcc-2.95:
tmp/g> c++ -c x.ii
x.ii:2: `X<T>' does not have a nested type named `Y'
x.ii:2: template class without a name
x.ii:2: template class without a name
x.ii:2: confused by earlier errors, bailing out
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8561