← board

C VLA char test[argc] + label as sole statement of braceless if

Failing test

Split hint: const-expr array bounds (easy, real-world) vs VLA (big). Consider fixing the const-fold part first; VLA may stay a documented skip.

Gate

Drop 00207.c from test/c-conformance/pxx.skip; runner green (or re-tag skip as VLA-only).

Update 2026-07-07

The const-fold half advanced: the constant-expression evaluator now handles ?: || && and comparisons (commit 41dac3b8), so int a[1 && 1] and int b[1 || 1] array bounds fold correctly. Remaining for 00207:

Trace 2026-07-07 — array-bound ternary else-branch bug pinned

Instrumented CEvalConstTernary on int a[2?3:4]: cond done (CurTok=tkQuestion), then-branch = 3 (correct, CurTok=tkColon), after consuming ':' CurTok = the 4 integer token — but the ELSE-branch e := CEvalConstTernary returns 2, not 4, and leaves CurTok on that integer (so the array loop's Expect(']') fails). So the else-branch reads the WRONG value / mis-tracks token position, but ONLY in the array-dim eval context (scalar/enum/global const ternary is correct). Subtle mutual-recursion / token-position bug in the const evaluator's array-dim call path — needs focused debugging (compare TokPos handling of the array-dim CEvalConstExpr call site vs the scalar-init one).

Update 2026-07-07 (2) — compiles + runs, VLA off-by-one remains

With the const-fold + array-ternary fixes, 00207 now COMPILES and RUNS (label in braceless if works, const-sized arrays fold). Output is off by ONE extra "boom!" (3 vs 2): f1's char test[argc] VLA re-declared each loop iteration interacts with the argc-- loop counter (a VLA-on-stack / counter aliasing off-by-one). So the ONLY remaining piece is true VLA semantics; everything else in 00207 passes. Still skipped pending VLA.

Log