2014-12-19 0:14 GMT+01:00 Jason Merrill <ja...@redhat.com>: > On 12/18/2014 01:16 PM, Kai Tietz wrote: >> >> 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. > > > It's wrong, it just papers over the bug. There shouldn't be a mismatch at > this point. > > The problem seems to be that most_general_template isn't actually returning > the most general template, so we're trying to instantiate the > partially-instantiated alias template with a full set of arguments: thus the > mismatch. > > Jason >
Yes, in most_general_template we don't loop for TEMPLATE_DECL_ALIAS. ChangeLog 2014-12-19 Kai Tietz <kti...@redhat.com> * pt.c (most_general_template): Don't break for template-alias. Ok for apply (with testcase as posted before)? Regards, Kai Index: pt.c ================================================================== --- pt.c (Revision 218897) +++ pt.c (Arbeitskopie) @@ -19207,6 +19207,7 @@ most_general_template (tree decl) break; if (CLASS_TYPE_P (TREE_TYPE (decl)) + && !TYPE_DECL_ALIAS_P (TYPE_NAME (TREE_TYPE (decl))) && CLASSTYPE_TEMPLATE_SPECIALIZATION (TREE_TYPE (decl))) break;