On 04/30/2013 03:14 PM, Jason Merrill wrote:
On 04/30/2013 08:03 AM, Paolo Carlini wrote:
I'm wondering if handling the
additional TREE_CODE in finish_decltype_type isn't overall preferable
(assuming we wouldn't end up soon handling all sorts of *_EXPR ;)
That's exactly the problem; it wouldn't stop with ADDR_EXPR, we would
need to handle any form of expression that could be a template
non-type argument.
Ok.
Currently, in some cases (see, eg, template/canon-type-9.C) we have that
id is true and DECLTYPE_TYPE_EXPR (t) is a TEMPLATE_PARM_INDEX but the
tsubst_copy_and_build call returns a TEMPLATE_PARM_INDEX again, not an
ADDR_EXPR, not an expression, and inside finish_decltype_type the
instantiation_dependent_expression_p returns true. Shall we also
additionally check something like EXPR_P (type) in the special casing?
And then, is just type = TREE_TYPE (type) instead of calling
finish_decltype_type enough?
Too many questions, I know, if you feel like just working on this issue
and handle yourself the tricky details I'm still missing, just let me
know...
Thanks,
Paolo.