This is the mail archive of the
mailing list for the GCC project.
Re: [C++-11] User defined literals
- From: Jason Merrill <jason at redhat dot com>
- To: Ed Smith-Rowland <3dw4rd at verizon dot net>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 09 Oct 2011 00:15:11 +0100
- Subject: Re: [C++-11] User defined literals
- References: <4E6F6A1C.firstname.lastname@example.org> <4E7008DA.email@example.com> <4E76FBBB.firstname.lastname@example.org> <4E77B002.email@example.com> <4E77F549.firstname.lastname@example.org> <4E78F475.email@example.com> <4E8C7DF0.firstname.lastname@example.org> <4E8CC75A.email@example.com> <4E909588.firstname.lastname@example.org>
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
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.