Issue 141724
Summary [Clang] C23 struct compatiblity rule differs from GCC
Labels clang
Assignees
Reporter fuhsnn
    The last case shows that clang-21 currently treat two same-record structs without tag as compatible, while GCC doesn't.
```
struct     {int i;} nontag;
struct tag {int i;} tagged;

static_assert(1 == _Generic(tagged, struct tag {int i;}:1, default:0)); // both 1
static_assert(0 == _Generic(tagged, struct     {int i;}:1, default:0)); // both 0
static_assert(0 == _Generic(nontag, struct tag {int i;}:1, default:0)); // both 0
static_assert(0 == _Generic(nontag, struct     {int i;}:1, default:0)); // gcc:0 clang:1
```
https://godbolt.org/z/bGWfYT5WE
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to