The following invalid code snippet is accepted by GCC since at least GCC 2.95.3:
==================================== struct A { template<int> void foo() = 0; }; ==================================== A similar code snippet causes an ICE since GCC 4.0.0: ==================================== struct A { template<int> void foo() = 1; }; ==================================== bug.cc:3: internal compiler error: in grokfield, at cp/decl2.c:899 Please submit a full bug report, [etc.] It was rejected before, but only because the pure specifier was malformed, and not because it was present at all: bug.cc:3: error: invalid initializer for virtual method `void A::foo()' -- Summary: [4.0/4.1/4.2 regression] Pure specifiers for templates causing trouble Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code, accepts-invalid, 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=26122