2014-12-18 18:26 GMT+01:00 Jason Merrill <ja...@redhat.com>: > On 12/18/2014 10:10 AM, Kai Tietz wrote: >> >> + if (TMPL_ARGS_DEPTH (args) > TMPL_PARMS_DEPTH (tmpl_parms)) >> + args = get_innermost_template_args >> + (args, TMPL_PARMS_DEPTH (tmpl_parms)); > > > It seems unlikely to be correct to arbitrarily strip off outer template > args. Where did the mismatch come from? > > Jason >
Hmm, we are comming from #2 tsubst_decl (cp/pt.c:11278) #3 instantiate_template_1 (cp/pt.c:15945) #4 instantiate_template (cp/pt.c:15995) #5 instantiate_alias_template (cp/pt.c:11827) #6: lookup_template_class_1 #7: lookup_template_class #8: finish_template_type #9: cp_parser_template_id .... Well, in general I would have assumed to be able to get alias decl of tmpl. Wasn't able to find a simple way to get it. So, by looking into source I found that most cases handling args > tmpl-args by using inner_most_template_args instead. Defaulting to innermost_template_args looks indeed a bit wrong, but seemed to work. Kai