This is the mail archive of the 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++/7994: <synopsis of the problem (one line)>

>Number:         7994
>Category:       c++
>Synopsis:       <synopsis of the problem (one line)>
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 21 06:16:01 PDT 2002
>Originator:     VÁCLAV HAISMAN
>Release:        3.3 20020920 (experimental)
System: FreeBSD 4.6-STABLE FreeBSD 4.6-STABLE #0: Thu Aug 1 01:02:04 CEST 2002 i386

host: i386-unknown-freebsd4.6
build: i386-unknown-freebsd4.6
target: i386-unknown-freebsd4.6
configured with: ../srcdir/configure --enable-threads --enable-languages=c,c++ --enable-version-specific-runtime-libs --prefix=/home/4/wilx --with-arch=i686 --with-cpu=i686
ICE on attached test case.
logout ~/tmp>c++ -c testcase-cast.cxx
testcase-cast.cxx: In member function `virtual bool REChar::equal(const RE&)':
testcase-cast.cxx:17: error: cannot convert from base `RE' to derived type `
   REChar' via virtual base `RE'
testcase-cast.cxx:17: internal compiler error: in comptypes, at cp/typeck.c:913
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:> for instructions.

#include <typeinfo>

class RE {
    virtual bool equal(const RE& re) = 0;

class REChar : virtual public RE {
    char ch;
    virtual bool equal(const RE& re);

bool REChar::equal(const RE& re)
    if (typeid(re) == typeid(REChar))
	if (ch == static_cast<const REChar&>(re).ch)
	    return true;
    return false;


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