On 02/09/2015 08:27 AM, Andrea Azzarone wrote:
Please note that this is my first gcc patch
Thanks, looks good! A couple of nits:
* gcc/cp/parser.c: Make sure lookup_literal_operator returns all the possible candidates. Also improve the diagnostic messages.
A ChangeLog entry should be per function, e.g. * parser.c (lookup_literal_operator): Return all candidates. (cp_parser_userdef_numeric_literal): Pass tf_warning_or_error. (cp_parser_userdef_string_literal): Likewise. Prefer the non-template form.
@@ -4044,31 +4061,15 @@ cp_parser_userdef_string_literal (tree l { tree tmpl_args = make_string_pack (value); decl = lookup_template_function (decl, tmpl_args); - result = finish_call_expr (decl, &args, false, true, tf_none); + result = finish_call_expr (decl, &args, false, true, tf_warning_or_error); if (result != error_mark_node) - { - release_tree_vector (args); - return result; - } + { + release_tree_vector (args); + return result; + } }
Why not remove the test against error_mark_node here like you did in cp_parser_userdef_numeric_literal?
Jason