From 062c4bb37ac6f2af6753060d8f8db5230bc18b49 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 4 Feb 2009 00:59:21 +0000 Subject: re PR c/29129 ([DR#341] unnamed parameters using [*]) PR c/29129 * c-decl.c (grokdeclarator): Mark [*] arrays in field declarators as having variable size. Do not give an error for unnamed parameters with [*] declarators. Give a warning for type names with [*] declarators and mark them as variable size. * c-parser.c (c_parser_sizeof_expression): Do not give an error for sizeof applied to [*] type names. testsuite: * c90-arraydecl-1.c: Do not expect error for [*] in abstract declarator. * vla-6.c: Likewise. Expect warning not error for [*] lexically inside function prototype but not part of parameter declarator. * vla-11.c: New test. From-SVN: r143918 --- gcc/c-parser.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'gcc/c-parser.c') diff --git a/gcc/c-parser.c b/gcc/c-parser.c index 8844769..199a5a7 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -4949,13 +4949,6 @@ c_parser_sizeof_expression (c_parser *parser) /* sizeof ( type-name ). */ skip_evaluation--; in_sizeof--; - if (type_name->declarator->kind == cdk_array - && type_name->declarator->u.array.vla_unspec_p) - { - /* C99 6.7.5.2p4 */ - error_at (expr_loc, - "%<[*]%> not allowed in other than a declaration"); - } return c_expr_sizeof_type (type_name); } else -- cgit v1.1