From 1d7b3af0633502c6f63f642d45e5096be28b5f91 Mon Sep 17 00:00:00 2001 From: lemon Date: Wed, 15 Oct 2025 10:39:41 +0200 Subject: c: cast/compound lit distinction is syntax based --- c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c.c b/c.c index 7eae3e6..7135108 100644 --- a/c.c +++ b/c.c @@ -797,7 +797,7 @@ Unary: struct decl decl = pdecl(&st, cm); expect(cm, ')', NULL); assert(decl.ty.t); - if ((isagg(decl.ty) || decl.ty.t == TYARRAY) && peek(cm, NULL) == '{') { + if (peek(cm, NULL) == '{') { if (ccopt.cstd < STDC99) warn(&tk.span, "compound literals are a c99 feature"); ex = initializer(cm, &decl.ty, (decl.scls & SCSTATIC) ? EVSTATICINI : EVFOLD, -- cgit v1.2.3