// Once we've initialized a field of an anonymous union, the union
// field in the class is also initialized, so exit immediately.
return false;
+ } else if ((*FA)->isAnonymousStructOrUnion()) {
+ if (CollectFieldInitializer(Info, Top, *FA))
+ return true;
}
}
// CHECK-NEXT: [[CVALUE:%.*]] = getelementptr inbounds {{.*}} [[STRUCT]], i32 0, i32 0
// CHECK-NEXT: store i8* null, void i8** [[CVALUE]]
}
+
+struct S {
+ // CHECK: store i32 42
+ // CHECK: store i32 55
+ S() : x(42), y(55) {}
+ union {
+ struct {
+ int x;
+ union { int y; };
+ };
+ };
+} s;