Since type inference was implemented in Clang for C23, it appears that we do not check if there is a mismatch between the declared type and the deduced type in C, as we do in C++.
For example: auto s[3] = "abc"
is deduced as char[4]
and therefore should not be compatible with char[3]
, but we do not enforce this check in C mode and end up with char[4]
instead of bailing out with char[3]
!= char[4]
.
Godbolt C example
Godbolt C++ example