5 // Gimplification of the COND_EXPR used to fail because it had an
6 // addressable type, and create_tmp_var rejected that.
19 (B&) (b ? foo() : foo());
22 // Make sure bit-fields and addressable types don't cause crashes.
23 // These were not in the original bug report.
25 // Added by Alexandre Oliva <aoliva@redhat.com>
27 // Copyright 2005 Free Software Foundation
31 long i : 32, j, k : 32;
43 (void)(b ? x.i : x.j);
44 (void)(b ? x.i : x.k);
45 (void)(b ? x.j : x.k);
47 g (b ? x.i : x.j); // { dg-error "cannot bind bitfield" }
48 g (b ? x.i : x.k); // { dg-error "cannot bind bitfield" }
49 g (b ? x.j : x.k); // { dg-error "cannot bind bitfield" }
51 // It's not entirely clear whether these should be accepted. The
52 // conditional expressions are lvalues for sure, and 8.5.3/5 exempts
53 // lvalues for bit-fields, but it's not clear that conditional
54 // expressions that are lvalues and that have at least one possible
55 // result that is a bit-field lvalue meets this condition.
60 (long &)(b ? x.i : x.j); // { dg-error "address of bit-field" }
61 (long &)(b ? x.i : x.k); // { dg-error "address of bit-field" }
62 (long &)(b ? x.j : x.k); // { dg-error "address of bit-field" }