Skip to content

Pre-C23 arrays of qualified type shouldn't be considered qualified #164347

@Halalaluyafail3

Description

@Halalaluyafail3

The following program demonstrates the issue:

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"diverges-from:gccDoes the clang frontend diverge from gcc on this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions