------- Comment #5 from jakub at gcc dot gnu dot org 2008-09-10 15:10 ------- I think primarily we want to agree on what is and is not valid lvalue when bitfields are involved.
int a; int b; struct A { int i:8; int j:8; int k:16; int l:32; } c; void foo (int x, int y) { (x ? a : b) = y; (x ? c.i : c.j) = y; // error with #c3 patch (x ? c.i : a) = y; // error with #c3 and #c5 patch (x ? c.i : c.k) = y; // error with #c3 and #c5 patch #if __INT_MAX__ == 2147483647 (x ? c.l : b) = y; #endif } If all are supposed to be valid, then I fixing this is going to be hard. We'll need to create COND_EXPR with mismatching types and then fix it up immediately once we figure out the COND_EXPR isn't used as lvalue. The #c3 patch is above, I'll attach another patch as well which allows bitfields if they have the same declared type and precision. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37146