aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index df9284c8..7f4eeaf 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -9219,7 +9219,15 @@ cp_parser_using_declaration (parser)
else
{
decl = cp_parser_lookup_name_simple (parser, identifier);
- if (scope)
+ if (decl == error_mark_node)
+ {
+ if (parser->scope && parser->scope != global_namespace)
+ error ("`%D::%D' has not been declared",
+ parser->scope, identifier);
+ else
+ error ("`::%D' has not been declared", identifier);
+ }
+ else if (scope)
do_local_using_decl (decl);
else
do_toplevel_using_decl (decl);