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

[Clang] Accepts invalid auto on a declaration of class

Open YuchangSu opened this issue 2 years ago • 2 comments

auto class X1 { } ;

See Compiler Explorer: https://godbolt.org/z/3WheK64E3 auto can only be specified for variables or function declarations.It is rejected by GCC, but accepted by Clang.

YuchangSu avatar Nov 04 '24 08:11 YuchangSu

@llvm/issue-subscribers-clang-frontend

Author: None (YuchangSu)

``` auto class X1 { } ; ``` See Compiler Explorer: [https://godbolt.org/z/3WheK64E3](https://godbolt.org/z/3WheK64E3) auto can only be specified for variables or function declarations.It is rejected by GCC, but accepted by Clang.

llvmbot avatar Nov 04 '24 15:11 llvmbot

This goes back a while: https://godbolt.org/z/P41x96f4x

shafik avatar Nov 05 '24 05:11 shafik