The following invalid code snippet triggers an ICE since at least GCC 2.95.3 (with the exception of 3.3.[2-6] where the code is wrongly accepted):
======================================== struct A { template<int> void foo(); }; template<int> struct B { friend void A::foo<0>(int = 0); }; ======================================== bug.cc:9: internal compiler error: Segmentation fault Please submit a full bug report, [etc.] Btw, the bug is related to PR13166, but not quite identical: If I remove the class around foo, the code is rejected correctly. -- Summary: ICE with default argument in friend declaration Product: gcc Version: 4.4.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=39057