- declaration = internal_record_declaration(declaration, false);
- const type_t *type = skip_typeref(declaration->type);
-
- /* check the type here for several not allowed combinations */
- if (type->kind == TYPE_FUNCTION) {
- const function_type_t* function_type = &type->function;
- const type_t* ret_type = skip_typeref(function_type->return_type);
-
- if (ret_type->kind == TYPE_FUNCTION) {
- errorf(declaration->source_position, "'%Y' declared as function returning a function",
- declaration->symbol);
- declaration->type = type_error_type;
- } else if (ret_type->kind == TYPE_ARRAY) {
- errorf(declaration->source_position, "'%Y' declared as function returning an array",
- declaration->symbol);
- declaration->type = type_error_type;
- }
- }
- if (! is_valid_array_type(type)) {
- errorf(declaration->source_position, "declaration of '%Y' as array of voids",
- declaration->symbol);
- declaration->type = type_error_type;
- }
- return declaration;