diff options
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r-- | gcc/c-parser.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c index 1e868af..cf34e04 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -7482,6 +7482,14 @@ c_parser_objc_type_name (c_parser *parser) type_name = c_parser_type_name (parser); if (type_name) type = groktypename (type_name, NULL, NULL); + + /* If the type is unknown, and error has already been produced and + we need to recover from the error. In that case, use NULL_TREE + for the type, as if no type had been specified; this will use the + default type ('id') which is good for error recovery. */ + if (type == error_mark_node) + type = NULL_TREE; + return build_tree_list (quals, type); } |