The following invalid code snippet triggers a segfault since GCC 3.4.0: ================================================== struct A { template<int> void foo() { A().template *foo<0>(); } }; ==================================================
bug.cc: In member function 'void A::foo()': bug.cc:5: error: expected unqualified-id before '*' token bug.cc:5: internal compiler error: Segmentation fault Please submit a full bug report, [etc.] Without the template keyword the compiler ICEs without a suitable error message: ================================================== struct A { template<int> void foo() { A().*foo<0>(); } }; ================================================== bug.cc: In member function 'void A::foo()': bug.cc:5: internal compiler error: Segmentation fault Please submit a full bug report, [etc.] -- Summary: [4.0/4.1/4.2 regression] ICE on invalid use of "*" in template Product: gcc Version: 4.2.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=29021