Issue 149965
Summary C23 structure and union compatibility should allow for compatible members
Labels new issue
Assignees
Reporter Halalaluyafail3
    It seems like Clang is working to support C23 new tag compatibility rules, however there are some issues currently. Here is one of them:
```c
struct A{int h;};
int main(){
    extern struct A x;
 enum E:int{e};
    struct A{enum E h;};
    extern struct A x;
}
```
Clang rejects this code because it considers the two structure types to be incompatible. They should be compatible because int and enum E are compatible, exact type equivalence is not required by the standard. The resulting composite type for x should have h as the composite type of int and enum E.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to