Given the following example: --- struct foo { int a; union { int a; double b; }; }; int main(void) { struct foo f; f.a = 123; return 0; } --- How it came to be: Accidental error where I had forgotten to remove foo.a after having added foo.{anonymous}.a. What has been observed: It compiles fine, which caused this programming error of mine to go unnoticed for half a day. It seems gcc gives foo.a precedence over foo.{anonymous}.a when accessing it through f.a=.... What had been expected: I would have liked that gcc emit at least a warning because f.a is ambiguous.
Fixed in 4.6.
Fixed in 4.6. *** This bug has been marked as a duplicate of bug 4784 ***