This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/8066: ICE when compiling incorrect template class initialization
- From: d98peter at dtek dot chalmers dot se
- To: gcc-gnats at gcc dot gnu dot org
- Date: 27 Sep 2002 06:47:29 -0000
- Subject: c++/8066: ICE when compiling incorrect template class initialization
- Reply-to: d98peter at dtek dot chalmers dot se
>Number: 8066
>Category: c++
>Synopsis: ICE when compiling incorrect template class initialization
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-illegal-code
>Submitter-Id: net
>Arrival-Date: Thu Sep 26 23:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Peter Strand
>Release: 3.2.1 20020830 (Debian prerelease)
>Organization:
>Environment:
Debian GNU/Linux testing/unstable, i686 PC
>Description:
Fails to give error message on incorrect code.
% gcc-3.2 foo2.cc
foo2.cc: In constructor `T<B>::T() [with B = B]':
foo2.cc:12: instantiated from here
foo2.cc:8: Internal compiler error in sort_base_init, at cp/init.c:598
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
Version 3.0.4 gives correct error message:
% gcc-3.0 foo2.cc
foo2.cc: In constructor `T<B>::T() [with B = B]':
foo2.cc:12: instantiated from here
foo2.cc:8: `B' is not an immediate base class of `T<B>'
>How-To-Repeat:
class B { };
template<class T> struct S : public T {
S() { }
};
template<class B> struct T : public S<B> {
T() : B() { }
};
struct U : public T<B> {
U() : T<B>() { }
};
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: