llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[Clang][Windows] Accepts invalid `[] int x;`

Open MagentaTreehouse opened this issue 11 months ago • 6 comments

[] int x;

This code is invalid but accepted by Clang on Windows, reproducible with the main branch. See https://compiler-explorer.com/z/s65rv9Pcf. (clang-cl 18.1 only)

MagentaTreehouse avatar Dec 20 '25 16:12 MagentaTreehouse

Could you please try 21 or main branch? Only most recent release is maintained.

EugeneZelenko avatar Dec 20 '25 16:12 EugeneZelenko

@llvm/issue-subscribers-clang-frontend

Author: None (MagentaTreehouse)

```c++ [] int x; ``` This code is invalid but accepted by Clang on Windows, reproducible with the main branch. See https://compiler-explorer.com/z/s65rv9Pcf. (clang-cl 18.1 only)

llvmbot avatar Dec 20 '25 16:12 llvmbot

Could you please try 21 or main branch? Only most recent release is maintained.

@EugeneZelenko Yes, this is reproducible with the main branch as described in the OP. It is Compiler Explorer that provides 18.1 only for clang-cl.

MagentaTreehouse avatar Dec 20 '25 16:12 MagentaTreehouse

Also reproducible with -fms-extensions and usual clang driver on main: https://compiler-explorer.com/z/xcs6axovW

keinflue avatar Dec 20 '25 17:12 keinflue

Goes all the way back to after clang-2.8: https://compiler-explorer.com/z/6sceKEzTM

shafik avatar Dec 28 '25 06:12 shafik

CC @AaronBallman

shafik avatar Dec 28 '25 06:12 shafik