Issue 164347
Summary Pre-C23 arrays of qualified type shouldn't be considered qualified
Labels new issue
Assignees
Reporter Halalaluyafail3
    The following program demonstrates the issue:
```c
int main(void){
    const int(*p)[2]=0;
 void*q=p;
}
```
Before C23, `const int[2]` was not considered a qualified type so this conversion was valid. GCC allows it, Clang incorrectly rejects it. Here is another example that demonstrates the opposite:
```c
int main(void){
    int(*p)[2]=0;
    const int(*q)[2]=p;
}
```
`const int[2]` is not a qualified version of `int[2]` before C23, so this conversion was invalid. GCC rejects it, Clang incorrectly allows it.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to