aaron.ballman added inline comments.
================ Comment at: clang/test/Sema/ext-int.c:7 _ExtInt(32) s32, int b) { - b ? s30 : s31a; // expected-error{{incompatible operand types}} - b ? s31a : s30; // expected-error{{incompatible operand types}} - b ? s32 : 0; // expected-error{{incompatible operand types}} + b ? s30 : s31a; + b ? s31a : s30; ---------------- rsmith wrote: > erichkeane wrote: > > aaron.ballman wrote: > > > erichkeane wrote: > > > > Wouldn't mind some type-checking tests here if possible. Or at least > > > > SOMEWHERE to make sure this produces the correct types, something with > > > > a static-assert would be great! > > > There's not a super easy way to do `is_same` in C, but I could add some > > > AST dumping tests that involve `__typeof__` if that'd work for you? > > yep! That'd be fine. > Can you build `is_same` out of `_Generic`? Eg, `_Static_assert(_Generic(b ? > s30 : s31a, EI31: 1, default: 0, "");` @rsmith -- great minds think alike, I was just heading down that route. :-) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105997/new/ https://reviews.llvm.org/D105997 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits