This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Refactor implicit function template implementation and fix 58534, 58536, 58548, 58549 and 58637.
- From: Adam Butcher <adam at jessamine dot co dot uk>
- To: Jason Merrill <jason at redhat dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>, Volker Reichelt <reichelt at gcc dot gnu dot org>
- Date: Sun, 10 Nov 2013 10:38:52 +0000
- Subject: Re: [C++ PATCH] Refactor implicit function template implementation and fix 58534, 58536, 58548, 58549 and 58637.
- Authentication-results: sourceware.org; auth=none
- References: <1383212824-5493-1-git-send-email-adam at jessamine dot co dot uk> <1383212824-5493-2-git-send-email-adam at jessamine dot co dot uk> <527D328D dot 9010800 at redhat dot com> <48a0350ad377d7ec6de413e61724fe4e at imap dot force9 dot net> <527F2364 dot 3060404 at redhat dot com>
On 2013-11-10 6:10, Jason Merrill wrote:
Hmm, actually I think messing with the non-pack's decl is dangerous,
and we should come up with a new decl for the pack instead. I think
you can use reduce_template_parm_level with a "levels" argument of 0
to build a new decl and parm index.
I actually did this in one of my experiments and it worked fine.
Although I also had to update the template parm list with new decl:
TREE_VALUE (TREE_VEC_ELT (current, i)) = TREE_CHAIN (t);
At that point I had the convert function in pt.c an operating directly
on current_template_parms (also having direct access to the two statics
required; reduce_template_parm_level and canonical_type_parameter).
I can't think of a case where we'd want to make this substitution in
anything but the current_template_parms so maybe moving the convert
function back into to pt.c and removing the 'current' parm from it
might be best?
And if we're doing that, setting TYPE_STUB_DECL and TYPE_NAME is
indeed necessary.
Only for the sake of not exposing this (currently static) function
from
pt.c (or moving the pack convert function into pt.c). My original
impl
did extern canonical_type_parameter and use that and I think it
worked
as expected. Would that be preferred?
Yes. Please declare it in cp-tree.h rather than within the function.
Will do. Unless, as suggested above, we go for moving
convert_generic_types_to_packs into pt.c in which case exposing these
internals won't be necessary.
Cheers,
Adam
- References:
- Re: [SKETCH] Refactor implicit function template implementation and fix 58534, 58536, 58548, 58549 and 58637.
- [C++ PATCH 1/3] Refactor implicit function template implementation and fix 58534, 58536, 58548, 58549 and 58637.
- Re: [C++ PATCH] Refactor implicit function template implementation and fix 58534, 58536, 58548, 58549 and 58637.
- Re: [C++ PATCH] Refactor implicit function template implementation and fix 58534, 58536, 58548, 58549 and 58637.
- Re: [C++ PATCH] Refactor implicit function template implementation and fix 58534, 58536, 58548, 58549 and 58637.