Re: [C++ Patch] PR 34892

2012-10-24 Thread Jason Merrill
OK. Jason

Re: [C++ Patch] PR 34892

2012-10-24 Thread Paolo Carlini
Hi, On 10/25/2012 03:53 AM, Jason Merrill wrote: We can stop it even sooner: /* If the next token is an ellipsis, and we don't already have it marked as a parameter pack, then we have a parameter pack (that has no declarator). */ if (!*is_parameter_pack && cp_lexer_next_to

Re: [C++ Patch] PR 34892

2012-10-24 Thread Jason Merrill
We can stop it even sooner: /* If the next token is an ellipsis, and we don't already have it marked as a parameter pack, then we have a parameter pack (that has no declarator). */ if (!*is_parameter_pack && cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS) && decla

Re: [C++ Patch] PR 34892

2012-10-24 Thread Paolo Carlini
Hi again, On 10/24/2012 09:53 PM, Jason Merrill wrote: The parm shouldn't be a parameter pack in that case; the ... is part of the default argument, not the parameter. I tracked down where this goes wrong, in the parser: the below recognizes when cp_parser_parameter_declaration doesn't parse a

Re: [C++ Patch] PR 34892

2012-10-24 Thread Paolo Carlini
On 10/24/2012 09:53 PM, Jason Merrill wrote: On 10/24/2012 02:11 PM, Paolo Carlini wrote: The problem is that the first time we go through the loop, when parm_idx == 0 and TREE_PURPOSE is error_mark_node, the condition: if (template_parameter_pack_p (TREE_VALUE (parm)) && !(arg &&

Re: [C++ Patch] PR 34892

2012-10-24 Thread Jason Merrill
On 10/24/2012 02:11 PM, Paolo Carlini wrote: The problem is that the first time we go through the loop, when parm_idx == 0 and TREE_PURPOSE is error_mark_node, the condition: if (template_parameter_pack_p (TREE_VALUE (parm)) && !(arg && ARGUMENT_PACK_P (arg))) near the beginning o

Re: [C++ Patch] PR 34892

2012-10-24 Thread Paolo Carlini
Hi, On 10/24/2012 07:30 PM, Jason Merrill wrote: On 10/24/2012 01:20 PM, Paolo Carlini wrote: + if (parm == error_mark_node + || TREE_PURPOSE (parm) == error_mark_node) It seems odd to bail out early if the default argument is bad even if we aren't trying to use it. Doesn't it wor

Re: [C++ Patch] PR 34892

2012-10-24 Thread Jason Merrill
On 10/24/2012 01:20 PM, Paolo Carlini wrote: + if (parm == error_mark_node + || TREE_PURPOSE (parm) == error_mark_node) It seems odd to bail out early if the default argument is bad even if we aren't trying to use it. Doesn't it work to check this further down where we actually

[C++ Patch] PR 34892

2012-10-24 Thread Paolo Carlini
Hi, a *very* old ICE on invalid, even a regression (from before variadic templates, I guess!). I tried various other tweaks, like catching the issue earlier but diagnostic quality decreases, too many cascading error messages. The below means I have to tweak only a couple of existing testcases