From e6cfa951befbfbab3a14e4c3f0413c508b8b663f Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Fri, 12 Sep 2008 06:25:37 +0000 Subject: [PATCH] skip_typeref(). [r21880] --- parser.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/parser.c b/parser.c index 7fb6c97..ced2ef6 100644 --- a/parser.c +++ b/parser.c @@ -5224,11 +5224,10 @@ static void parse_external_declaration(void) 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 @@ -6873,10 +6872,10 @@ static expression_t *parse_call_expression(unsigned precedence, 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; -- 2.20.1