]> granicus.if.org Git - clang/commitdiff
Add another devilish testcase for designated initializers
authorDouglas Gregor <dgregor@apple.com>
Thu, 29 Jan 2009 01:10:11 +0000 (01:10 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 29 Jan 2009 01:10:11 +0000 (01:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63262 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/designated-initializers.c

index 5c61faa66794423b8d12d8f7afc2e7e069dc3f9b..efd0d406511b82f7b6390ae1aae70d87a78309ca 100644 (file)
@@ -145,5 +145,10 @@ extern float global_float;
 struct XX { int a, *b; };
 struct XY { int before; struct XX xx, *xp; float* after; } xy[] = {
   0, 0, &xy[0].xx.a, &xy[0].xx, &global_float,
-  [1].xx = 0, &xy[1].xx.a, &xy[1].xx, &global_float
+  [1].xx = 0, &xy[1].xx.a, &xy[1].xx, &global_float,
+  0, // expected-note{{previous initialization is here}}
+  0, // expected-note{{previous initialization is here}}
+  [2].before = 0, // expected-warning{{initializer overrides prior initialization of this subobject}}
+  0, // expected-warning{{initializer overrides prior initialization of this subobject}}
+  &xy[2].xx.a, &xy[2].xx, &global_float
 };