From 627895ac20db8e2fd4225927f41ae1af74609345 Mon Sep 17 00:00:00 2001 From: jason Date: Fri, 13 Nov 2009 02:20:41 +0000 Subject: [PATCH] PR c++/27078 * parser.c (cp_parser_primary_expression): Don't give a duplicate ambiguity error. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154139 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 10 ++++------ gcc/cp/parser.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index aa2563a..988b602 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2009-11-12 Jason Merrill + PR c++/27078 + * parser.c (cp_parser_primary_expression): Don't give a duplicate + ambiguity error. + PR c++/39560 * decl2.c (build_anon_union_vars): Set DECL_ARTIFICIAL. @@ -10,16 +14,12 @@ * call.c (build_conditional_expr): Check specifically for folding to CALL_EXPR rather than TREE_SIDE_EFFECTS. -2009-11-12 Jason Merrill - * typeck.c (cv_qualified_p): New fn. (decay_conversion): Use it. * cp-tree.h: Declare it. * tree.c (rvalue): Use it and cv_unqualified. * init.c (build_aggr_init): Likewise. -2009-11-12 Jason Merrill - PR c++/42013 * call.c (build_conditional_expr): Don't fold a TREE_SIDE_EFFECTS COND_EXPR in unevaluated context. @@ -33,8 +33,6 @@ PR c++/39131 * rtti.c (emit_support_tinfos): Add DFP types. -2009-11-11 Jason Merrill - * call.c (build_op_delete_call): Downgrade error about placement/non-placement confusion to permerror. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 3475723..f77ec55 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -3509,6 +3509,16 @@ cp_parser_primary_expression (cp_parser *parser, { tree ambiguous_decls; + /* If we already know that this lookup is ambiguous, then + we've already issued an error message; there's no reason + to check again. */ + if (id_expr_token->type == CPP_NAME + && id_expr_token->ambiguous_p) + { + cp_parser_simulate_error (parser); + return error_mark_node; + } + decl = cp_parser_lookup_name (parser, id_expression, none_type, template_p, -- 2.7.4