On 2013-11-10 18:49, Jason Merrill wrote:
On 11/10/2013 08:10 AM, Adam Butcher wrote:
+ /* Build up a tree vec of empty tree vecs up to the inner
substitution
+ args built above. */
I think we want to copy the enclosing args; see existing uses of
add_outermost_template_args.
OK. I had that originally but I was concerned that it was wasteful
which is why I ended up using nullptrs for non-subst'd types in the
inner level and empty tree vecs for the prior levels. It seemed to work
as expected; I assumed that tsubst simply doesn't do anything with a
null tree substitution (i.e. it is an identity op). There will be an
additional, seemingly unnecessary, cost of copying these and the loop
above will presumably be required to set the non-subst'd types rather
than leave them as nullptr also.
Since we are tsubsting the declaration here and we only want to adjust
the template parameter types themselves at their declaration is this
really necessary? I've no problem with implementing this if it truly is
necessary but I don't want to add unnecessary cycles if not.
One other thing, by 'copy' I take it you mean copy the tree vecs of the
enclosing levels only, not also the types within them. And I also
assume that I'll need to set the currently unset types in the inner
level also?
Cheers
Adam