The following code is grammatically incorrect:
void func() {
if (1)
int x;
}
because an iteratation statement must be followed by a secondary-block, which is a kind of statement, which does not accept declarations accept as allowed by compound-statement. GCC properly rejects this code as did Clang 17, so this is a recent regression: https://godbolt.org/z/sj3de1T74