From adcaf06607c6021a0582da67a644108f2558de4b Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Wed, 17 Sep 2008 07:29:23 +0000 Subject: [PATCH] Still record the element type of arrays and the return type of functions, even if they are invalid. [r22027] --- parser.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/parser.c b/parser.c index 119677c..1d4b640 100644 --- a/parser.c +++ b/parser.c @@ -4162,17 +4162,16 @@ static type_t *construct_declarator_type(construct_type_t *construct_list, type_t *skipped_return_type = skip_typeref(type); if (is_type_function(skipped_return_type)) { errorf(HERE, "function returning function is not allowed"); - type = type_error_type; } else if (is_type_array(skipped_return_type)) { errorf(HERE, "function returning array is not allowed"); - type = type_error_type; } else { if (skipped_return_type->base.qualifiers != 0) { warningf(HERE, "type qualifiers in return type of function type are meaningless"); } - type = function_type; } + + type = function_type; break; } @@ -4213,12 +4212,9 @@ static type_t *construct_declarator_type(construct_type_t *construct_list, } type_t *skipped_type = skip_typeref(type); - if (is_type_atomic(skipped_type, ATOMIC_TYPE_VOID)) { + if (is_type_atomic(skipped_type, ATOMIC_TYPE_VOID)) errorf(HERE, "array of void is not allowed"); - type = type_error_type; - } else { - type = array_type; - } + type = array_type; break; } } -- 2.20.1