Pre-C23 arrays of qualified type shouldn't be considered qualified
Open
clang:frontend
diverges-from:gcc
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
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.
Contributor guide
Assessment
This issue has not been assessed yet.