diff options
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index a90dabd..17242ba 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -10726,8 +10726,10 @@ cp_parser_direct_declarator (cp_parser* parser, type = resolve_typename_type (scope, /*only_current_p=*/false); /* If that failed, the declarator is invalid. */ - if (type != error_mark_node) - scope = type; + if (type == error_mark_node) + error ("`%T::%D' is not a type", + TYPE_CONTEXT (scope), + TYPE_IDENTIFIER (scope)); /* Build a new DECLARATOR. */ declarator = build_nt (SCOPE_REF, scope, |