Re: [C++ Patch/RFC] PR 57092

2013-04-30 Thread Jason Merrill
On 04/30/2013 04:49 PM, Paolo Carlini wrote: Ok. Then shall we do something like the below? Yeah, just add a comment explaining that it's there to handle instantiated template non-type arguments. Jason

Re: [C++ Patch/RFC] PR 57092

2013-04-30 Thread Paolo Carlini
Hi, On 04/30/2013 08:57 PM, Jason Merrill wrote: On 04/30/2013 11:59 AM, Paolo Carlini wrote: 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

Re: [C++ Patch/RFC] PR 57092

2013-04-30 Thread Jason Merrill
On 04/30/2013 11:59 AM, Paolo Carlini wrote: 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 Good p

Re: [C++ Patch/RFC] PR 57092

2013-04-30 Thread Paolo Carlini
... sorry about the latter confabulations ;) I went almost crazy trying to avoid the copy_node, but in this case it seems really necessary. The below appears to regtest fine (already beyond g++.dg/dg.exp). Thanks, Paolo. /// Index: cp/pt.c ==

Re: [C++ Patch/RFC] PR 57092

2013-04-30 Thread Paolo Carlini
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'

Re: [C++ Patch/RFC] PR 57092

2013-04-30 Thread Jason Merrill
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 handl

Re: [C++ Patch/RFC] PR 57092

2013-04-30 Thread Paolo Carlini
Hi, On 04/29/2013 04:48 PM, Jason Merrill wrote: On 04/29/2013 05:05 AM, Paolo Carlini wrote: in this 4.8/4.9 Regression, finish_decltype_type doesn't handle ADDR_EXPR. Hmm...we're seeing the regression because previously finish_decltype_type would have just returned the type of the template

Re: [C++ Patch/RFC] PR 57092

2013-04-29 Thread Jason Merrill
On 04/29/2013 05:05 AM, Paolo Carlini wrote: in this 4.8/4.9 Regression, finish_decltype_type doesn't handle ADDR_EXPR. Hmm...we're seeing the regression because previously finish_decltype_type would have just returned the type of the template parameter so it wouldn't ever see the ADDR_EXPR a

[C++ Patch/RFC] PR 57092

2013-04-29 Thread Paolo Carlini
Hi, in this 4.8/4.9 Regression, finish_decltype_type doesn't handle ADDR_EXPR. In 4.7, finish_decltype_type deals with a TEMPLATE_PARM_INDEX and the testcase compiles fine, but it's quite easy - see c++/52282 - to trigger the same ICE there too (it would be nice to make progress on the latter