The following invalid code snippet triggers an ICE since GCC 4.1.2:
============================================
void foo()
{
struct A
{
friend void bar();
};
bar();
}
============================================
bug.cc: In function 'void foo()':
bug.cc:7: internal compiler error: in lookup_name_real, at
cp/name-lookup.c:4054
Please submit a full bug report, [etc.]
The code was wrongfully accepted before GCC 4.1.0, but correctly diagnosed in
GCC 4.1.0 and 4.1.1.
--
Summary: [4.1/4.2/4.3 regression] ICE with friend in local class
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code, 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=34912