http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47311
--- Comment #23 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-01-20 10:41:07 UTC --- Here is what I understand from this issue. In this example: template < typename > class A; template <class Key, class T, template < typename TF = T> class TC = A> class B; 1/ During the fixup of the default argument T of the parameter TF of the template template parm TC, we need to build the full list of implicit arguments we have so far which {[Key, T], TF}. [Key, T] are made from the template parameters of B. Note that [Key, T] are not fixed up yet because they will be fixed up when we have fully parsed all the parameters of B. 2/ That list {[Key, T], TF} is to be substituted into the default argument of TF, that happens to be T. The problem is at that point in fixup_template_parms, we don't have access to [KEY, T]. current_template_args returns {[NULL], TF}. Hence the crash in the substituting of 2/ I think no fixup should happen in 1/ as we should probably wait until the end of parsing the parms of B to fixup all it template parms at once.