This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36407] New: [4.3/4.4 regression] ICE with invalid conversion
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jun 2008 10:39:48 -0000
- Subject: [Bug c++/36407] New: [4.3/4.4 regression] ICE with invalid conversion
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following invalid code snippet triggers an ICE on mainline and the
4.3 branch:
====================================================
struct A
{
A(const A&);
};
struct B
{
operator A&();
};
void foo(const B& b)
{
const A a = b;
}
====================================================
bug.cc: In function 'void foo(const B&)':
bug.cc:13: error: passing 'const B' as 'this' argument of 'B::operator A&()'
discards qualifiers
bug.cc:13: error: invalid conversion from 'A' to 'A'
bug.cc:13: internal compiler error: in ocp_convert, at cp/cvt.c:627
Please submit a full bug report, [etc.]
This is a regression on the 4.3 branch as 4.3.0 didn't crash.
Note, that the error message "invalid conversion from 'A' to 'A'" isn't
really helpful.
--
Summary: [4.3/4.4 regression] ICE with invalid conversion
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code, error-recovery, monitored
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36407