Message ID | 51B78309.8000100@oracle.com |
---|---|
State | New |
Headers | show |
OK, but please add a comment. Jason
On 06/12/2013 03:38 PM, Jason Merrill wrote:
> OK, but please add a comment.
Thanks. I added this:
// cp_parser_lookup_name has the same diagnostic,
// thus make sure to emit it almost once.
Paolo.
On 06/12/2013 04:05 PM, Paolo Carlini wrote: > On 06/12/2013 03:38 PM, Jason Merrill wrote: >> OK, but please add a comment. > Thanks. I added this: > > // cp_parser_lookup_name has the same diagnostic, > // thus make sure to emit it almost once. As mentioned by Marc off-line, 'at most' is definitely better ;) Paolo.
Index: parser.c =================================================================== --- parser.c (revision 199944) +++ parser.c (working copy) @@ -5230,10 +5230,14 @@ cp_parser_nested_name_specifier_opt (cp_parser *pa decl); else if (ambiguous_decls) { - error_at (token->location, - "reference to %qD is ambiguous", - token->u.value); - print_candidates (ambiguous_decls); + if (cp_parser_uncommitted_to_tentative_parse_p + (parser)) + { + error_at (token->location, + "reference to %qD is ambiguous", + token->u.value); + print_candidates (ambiguous_decls); + } decl = error_mark_node; } else