to tell it that it wasn't (directly) designated. This way, we unwind
back to the explicit initializer list properly rather than getting
stuck in the wrong subobject. Fixes llvm.org/PR3519
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64155
91177308-0d34-0410-b5e6-
96231b3b80d8
// Check the remaining elements within this array subobject.
bool prevHadError = hadError;
- CheckArrayType(IList, CurrentObjectType, DesignatedStartIndex, true, Index,
+ CheckArrayType(IList, CurrentObjectType, DesignatedStartIndex, false, Index,
StructuredList, ElementIndex);
return hadError && !prevHadError;
}
0, // expected-warning{{initializer overrides prior initialization of this subobject}}
&xy[2].xx.a, &xy[2].xx, &global_float
};
+
+// PR3519
+struct foo {
+ int arr[10];
+};
+
+struct foo Y[10] = {
+ [1] .arr [1] = 2,
+ [4] .arr [2] = 4
+};
+
+struct bar {
+ struct foo f;
+ float *arr[10];
+};
+
+extern float f;
+struct bar saloon = {
+ .f.arr[3] = 1,
+ .arr = { &f }
+};