http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53492
Volker Reichelt <reichelt at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |accepts-invalid Last reconfirmed|2012-05-26 00:00:00 |2014-03-01 CC| |reichelt at gcc dot gnu.org Target Milestone|--- |4.7.4 Summary|internal compiler error: in |[4.7/4.8/4.9 Regression] |retrieve_specialization, at |ICE in |cp/pt.c:985 |retrieve_specialization, at | |cp/pt.c:985 --- Comment #4 from Volker Reichelt <reichelt at gcc dot gnu.org> --- Here's an even simpler testcase: ===================================================== template<typename> struct A { template<typename> struct B; }; template<> template<typename T> struct A<T>::B { B(int) {} }; A<int>::B<int> b; ===================================================== It crashes since GCC 4.0.0, but was correctly rejected before. So this qualifies as a regression. A slightly modified and still invalid testcase also crashes since GCC 4.0.0 but was wrongly accepted before: ===================================================== template<typename> struct A { template<typename> struct B; }; template<> template<typename T> struct A<T>::B { B() {} }; A<int>::B<int> b; ===================================================== Another variation is wrongly accepted since at least GCC 3.2: ===================================================== template<typename> struct A { template<typename> struct B; }; template<> template<typename T> struct A<T>::B {}; A<int>::B<int> b; =====================================================