Bug 7994 - <synopsis of the problem (one line)>
Summary: <synopsis of the problem (one line)>
Status: RESOLVED DUPLICATE of bug 8031
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.3
: P3 normal
Target Milestone: ---
Assignee: Kriang Lerdsuwanakij
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2002-09-21 06:16 UTC by Václav Haisman
Modified: 2003-06-12 00:15 UTC (History)
2 users (show)

See Also:
Host: i386-unknown-freebsd4.6
Target: i386-unknown-freebsd4.6
Build: i386-unknown-freebsd4.6
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Václav Haisman 2002-09-21 06:16:01 UTC
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:http://www.gnu.org/software/gcc/bugs.html> for instructions.

Release:
3.3 20020920 (experimental)

Environment:
System: FreeBSD logout.sh.cvut.cz 4.6-STABLE FreeBSD 4.6-STABLE #0: Thu Aug 1 01:02:04 CEST 2002 root@logout.sh.cvut.cz:/usr/src/sys/compile/logout 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

How-To-Repeat:
#include <typeinfo>

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

class REChar : virtual public RE {
    char ch;
public:
    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;
}
Comment 1 Kriang Lerdsuwanakij 2002-09-28 07:03:02 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed.
Comment 2 Kriang Lerdsuwanakij 2002-09-28 09:55:02 UTC
*** This bug has been marked as a duplicate of 8031 ***