This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/8066: ICE when compiling incorrect template class initialization


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]