template < unsigned > struct Combinatorial_map_base { static const unsigned dimension = 3; template<unsigned dim=dimension> struct One_dart_per_incident_cell_range: XXXXXXXXXdart_per_incident_cell_name<dim> { }; }; typedef Combinatorial_map_base<3> LCC_3; LCC_3::One_dart_per_incident_cell_range<>::iterator it; $ clang++ -fsyntax-only a.ii segfaults. It doesn't if I change the name starting with XXX. (produced by delta, I still don't think that's the bug I am after...)
It looks like when you type the XXX name, clang thinks you just mistyped "One_dart_per_incident_cell_range" and it carries on valiantly as though you had typed "One_dart_per_incident_cell_range". So, here's a slightly smaller test case: template<unsigned> struct B { static const unsigned dimension = 3; template<unsigned dim=dimension> struct A : A<dim> {}; }; B<0>::A<>::iterator it; It still segfaults when you try to compile that. I'm very new to clang, but I managed to trace the problem to here: http://clang.llvm.org/doxygen/SemaDeclCXX_8cpp_source.html#l08409 Base->getType()->getAs<RecordType>() is returning null, so when you call getDecl() on it, bad things happen. Hope this helps. =)
This doesn't actually involve typo correction. This slightly-reduced example fails in the same way: template < unsigned > struct X { static const unsigned dimension = 3; template<unsigned dim=dimension> struct Y: Y<dim> { }; }; typedef X<3> X3; X3::Y<>::iterator it;
Fixed in r155576.