Clang accepts declaration in a statement other than a compound statement #92775
Labels
accepts-invalid
c
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
confirmed
Verified by a second party
regression
The following code is grammatically incorrect:
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
The text was updated successfully, but these errors were encountered: