diff options
author | Jason Merrill <jason@redhat.com> | 2009-11-12 21:20:41 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2009-11-12 21:20:41 -0500 |
commit | 3791ce90f6b9262cf9c52b57303cb3e8c854e328 (patch) | |
tree | 78e06eaa6dc2e2d0ef9bde478a63d7c0c6dc3c93 /gcc/cp | |
parent | 2c312924d50476dcb5e0fc8dc573104ef85914c8 (diff) | |
download | gcc-3791ce90f6b9262cf9c52b57303cb3e8c854e328.zip gcc-3791ce90f6b9262cf9c52b57303cb3e8c854e328.tar.gz gcc-3791ce90f6b9262cf9c52b57303cb3e8c854e328.tar.bz2 |
re PR c++/27078 (Duplicate error message for ambiguous enum)
PR c++/27078
* parser.c (cp_parser_primary_expression): Don't give a duplicate
ambiguity error.
From-SVN: r154139
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 10 | ||||
-rw-r--r-- | 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 <jason@redhat.com> + 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 <jason@redhat.com> - * 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 <jason@redhat.com> - 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 <jason@redhat.com> - * 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, |