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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 0e0dccd..3e25076 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -12232,6 +12232,7 @@ cp_parser_class_name (cp_parser *parser,
decl = TYPE_NAME (make_typename_type (scope, decl, tag_type, tf_error));
else if (decl == error_mark_node
|| TREE_CODE (decl) != TYPE_DECL
+ || TREE_TYPE (decl) == error_mark_node
|| !IS_AGGR_TYPE (TREE_TYPE (decl)))
{
cp_parser_error (parser, "expected class-name");