return;
}
- if (warning.aggregate_return) {
- const type_t *return_type = type->function.return_type;
- if (is_type_compound(return_type))
- warningf(HERE, "function '%Y' returns an aggregate",
- ndeclaration->symbol);
+ if (warning.aggregate_return &&
+ is_type_compound(skip_typeref(type->function.return_type))) {
+ warningf(HERE, "function '%Y' returns an aggregate",
+ ndeclaration->symbol);
}
/* ยง 6.7.5.3 (14) a function definition with () means no
check_format(&result->call);
- if (warning.aggregate_return) {
- const type_t *return_type = function_type->return_type;
- if (is_type_compound(return_type))
- warningf(&result->base.source_position, "function call has aggregate value");
+ if (warning.aggregate_return &&
+ is_type_compound(skip_typeref(function_type->return_type))) {
+ warningf(&result->base.source_position,
+ "function call has aggregate value");
}
return result;