aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorOllie Wild <aaw@google.com>2007-07-01 20:49:29 +0000
committerOllie Wild <aaw@gcc.gnu.org>2007-07-01 20:49:29 +0000
commitaf92ab368ad709fcd26b360dc1cf4e50b0cd6185 (patch)
tree3d4fa643b8d41d6d480c77eb01d90ee5dc80d4ae /gcc/cp/parser.c
parent31c97dfe34220de54c1d93ce858af83bfda31fd3 (diff)
downloadgcc-af92ab368ad709fcd26b360dc1cf4e50b0cd6185.zip
gcc-af92ab368ad709fcd26b360dc1cf4e50b0cd6185.tar.gz
gcc-af92ab368ad709fcd26b360dc1cf4e50b0cd6185.tar.bz2
name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
* name-lookup.c (ambiguous_decl): Fix case when new->value is hidden. (select_decl): Remove function. (unqualified_namespace_lookup): Populate binding by calling ambiguous_decl. Remove select_decl call. (lookup_qualified_name): Remove select_decl call. * decl.c (lookup_and_check_tag): Check for ambiguous references. * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error generation when name lookup is ambiguous. * g++.dg/lookup/using16.C: New test. * g++.dg/lookup/using17.C: New test. From-SVN: r126177
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index ca6620c..484c6b5 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -10855,13 +10855,19 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
if (parser->scope)
{
tree decl;
+ tree ambiguous_decls;
decl = cp_parser_lookup_name (parser, identifier,
tag_type,
/*is_template=*/false,
/*is_namespace=*/false,
/*check_dependency=*/true,
- /*ambiguous_decls=*/NULL);
+ &ambiguous_decls);
+
+ /* If the lookup was ambiguous, an error will already have been
+ issued. */
+ if (ambiguous_decls)
+ return error_mark_node;
/* If we are parsing friend declaration, DECL may be a
TEMPLATE_DECL tree node here. However, we need to check