Jason Merrill <ja...@redhat.com> writes:
>> + /* This can happen for template parms of a template template >> + parameter, e.g: >> + >> + template<template<class T, class U> class TT> struct S; >> + >> + Consider the level of the parms of TT; T and U both have >> + level 2; TT has no template parm of level 1. So in this case >> + the first element of full_template_args is NULL_TREE. If we >> + leave it like this TMPL_ARG_DEPTH on args returns 1 instead >> + of 2. This will make tsubst wrongly consider that T and U >> + have level 1. Instead, let's create a dummy vector as the >> + first element of full_template_args so that TMPL_ARG_DEPTH >> + returns the correct depth for args. */ > > Hmm, it seems odd that the parms wouldn't have level 1. Finally, thinking about this a little more, this situation does not seem completely crazy to me. For: template<class T, template<class U, T> class TT> struct S; the parms of TT do have a level 1 that contains the parm T. It seems to me that we need T and U to have different levels here, so both cannot have level 1. > I wonder if changing that would also avoid needing to use structural > equality for template template parameters. What do you mean exactly by "changing that"? I am getting confused now. -- Dodji