This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11547] New: [3.4 regression] ICE with const temporaries
- 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: 16 Jul 2003 13:59:07 -0000
- Subject: [Bug c++/11547] New: [3.4 regression] ICE with const temporaries
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11547
Summary: [3.4 regression] ICE with const temporaries
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: critical
Priority: P1
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-pc-linux-gnu
The following valid code snippet crashes mainline since 3.4-20030709
(just compile with "g++ -c"):
---------------------------------------------
struct A
{
int foo () const { return 0; }
};
template <typename> void bar (int x[], const A &a)
{
const int i=a.foo();
x[i]=0;
}
---------------------------------------------
The error message is:
bug.ii: In function `void bar(int*, const A&)':
bug.ii:9: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]
If I remove the const qualifier on i, the code compiles fine.