This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] Refactor implicit function template implementation and fix 58534, 58536, 58548, 58549 and 58637.


On 11/10/2013 02:39 PM, Adam Butcher wrote:
I assumed that tsubst simply doesn't do anything with a
null tree substitution (i.e. it is an identity op).

Substituting NULL_TREE for a template parameter gives a template parameter with a reduced level; this happens during partial instantiation.

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.

The difference between setting copying a pointer to a vec versus setting it to null seems completely negligible to me.

I think it is necessary in case the function parameter type involves template parameters from the enclosing context as well as implicit template parameters.

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.

Yes, using add_outermost_template_args.

And I also assume that I'll need to set the currently unset types in the inner
level also?

Can you have explicit template parameters at the same level as the implicit ones? If so, then their places in the vec will need to be set appropriately in case they are used in the function parameter type.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]