Issue 164930
Summary C23 parsing of auto type inference doesn't correctly consider typedefs
Labels new issue
Assignees
Reporter Halalaluyafail3
    The following program demonstrates the issue:
```c
int main(){
    typedef int x;
    {
        auto x y;
 }
}
```
The declaration `auto x y;` should be "declaration of y with type x" where auto has no effect because it's not specifying type inference here. However, in C23 mode Clang will see the `x` after `auto` and then assume that it should be "declaration of x with inferred type". Afterwards it will then complain because there is no initializer. GCC and Clang in pre-C23 modes will accept this code. Related to #164921 example 3, but I split this into a separate issue because it changes the meaning of valid code.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to