================
@@ -7,3 +7,12 @@ void stmtexprs(int i) {
// expected-warning@+1 {{assumption is ignored because it contains
(potential) side-effects}}
__builtin_assume( ({ if (i) ({ stmtexpr_fn(); }); 1; }) );
}
+
+struct S {
+ unsigned b : 3;
+};
+
+void test_bitfield_promotion(struct S s) {
+ _Static_assert(_Generic(+({ s.b; }), int: 1, unsigned: 2) == 1,
----------------
AaronBallman wrote:
Can you also add these test cases just to round out coverage:
```
_Static_assert(_Generic(+s.b, int: 1, unsigned: 2) == 1,
"this should be promoted");
_Static_assert(_Generic(({ s.b; }), int: 1, unsigned: 2) == 2,
"this one does not get promoted");
_Static_assert(_Generic(s.b, int: 1, unsigned: 2) == 2,
"nor does this one");
```
https://github.com/llvm/llvm-project/pull/225597
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits