On 10/08/2011 07:15 PM, Jason Merrill wrote:
On 10/08/2011 07:25 PM, Ed Smith-Rowland wrote:
Also, In spite of the documentation cp_parser_template_parameter_list
returns a TREE_VEC not a TREE_LIST. This happens inside
end_template_parm_list called inside the former. So parameter_list is a
TREE_VEC, parm_list is a TREE_LIST, parm is a PARM_DECL, etc.
Ah, I was thinking of template arguments rather than parameters.
You're right, except that INNERMOST_TEMPLATE_PARMS should be just
TREE_VALUE; you are already starting from the innermost parm list if
you use what end_template_parm_list returns.
Though it occurs to me that push_template_decl_real might be a better
place for this check.
I'm still looking for a fix for duplicate errors/warnings coming from
cp_parser_operator. I tried cp_parser_error and lost the errors. I'll
look for different code paths for the two invocations and see if I can
either move something up or see if something is set differently between
the two that would be useful for a flag.
One approach would be changing the token stream after the first error
to something that won't produce another error, e.g. changing
token->u.value to be an empty string after you complain about it being
non-empty.
Interesting. That one error is the one of the three that does *not* repeat.
One idea. the fist error about non-empty string is followed by a
consume_token (for the string).
Does cp_parser_identifier (parser) *not* consume the identifier token?
Is that token left on the stream for second pass?
I'll try it and get back.
Jason