diff options
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 06e01ad..f9672a0 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -4865,6 +4865,8 @@ grokdeclarator (const struct c_declarator *declarator, tree expr_dummy; bool expr_const_operands_dummy; + if (TREE_CODE (type) == ERROR_MARK) + return error_mark_node; if (expr == NULL) expr = &expr_dummy; if (expr_const_operands == NULL) @@ -9315,9 +9317,9 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, else specs->type = TREE_TYPE (t); } - else if (TREE_CODE (type) != ERROR_MARK) + else { - if (spec.kind == ctsk_typeof) + if (TREE_CODE (type) != ERROR_MARK && spec.kind == ctsk_typeof) { specs->typedef_p = true; if (spec.expr) @@ -9332,11 +9334,6 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, } specs->type = type; } - else - { - /* Set a dummy type here to avoid warning about implicit 'int'. */ - specs->type = integer_type_node; - } return specs; } @@ -9452,6 +9449,10 @@ finish_declspecs (struct c_declspecs *specs) gcc_assert (!specs->long_p && !specs->long_long_p && !specs->short_p && !specs->signed_p && !specs->unsigned_p && !specs->complex_p); + + /* Set a dummy type. */ + if (TREE_CODE (specs->type) == ERROR_MARK) + specs->type = integer_type_node; return specs; } |