The following should have warnings: struct S { char a[6]; int b[2]; }; S S0 = { { "hello" }, { 1, 2 } }; S S1 = { { "hello" }, 1, 2 }; // { dg-warning "" } S S2 = { "hello", { 1, 2 } }; S S3 = { "hello", 1, 2 }; // { dg-warning "" }
Obviously I compiled with "-W -Wall". I wonder how this regression was missed for so long.
Yeah, caused by addition of reshape_init. Bigger testcase: // PR c++/20209 // { dg-do compile } // { dg-options "-Wmissing-braces" } struct S { char a[6]; int b[2]; }; struct T { int a; int b[2]; }; struct U { int a; T b; }; struct V { char a[6]; int b[2]; int c; }; struct W { int a; int b[2]; int c; }; struct X { int a; W b; int c; }; S a = { { "hello" }, { 1, 2 } }; S b = { { "hello" }, 1, 2 }; // { dg-warning "" } S c = { "hello", { 1, 2 } }; S d = { "hello", 1, 2 }; // { dg-warning "" } T e = { 1, { 2, 3 } }; T f = { 1, 2, 3 }; // { dg-warning "" } U g = { 1, { 2, { 3, 4 } } }; U h = { 1, 2, { 3, 4 } }; // { dg-warning "" } U i = { 1, 2, 3, 4 }; // { dg-warning "" } V j = { { "hello" }, { 1, 2 }, 3 }; V k = { { "hello" }, 1, 2, 3 }; // { dg-warning "" } V l = { "hello", { 1, 2 }, 3 }; V m = { "hello", 1, 2, 3 }; // { dg-warning "" } W n = { 1, { 2, 3 }, 4 }; W o = { 1, 2, 3, 4 }; // { dg-warning "" } X p = { 1, { 2, { 3, 4 }, 5 }, 6 }; X q = { 1, 2, { 3, 4 }, 5, 6 }; // { dg-warning "" } X r = { 1, 2, 3, 4, 5, 6 }; // { dg-warning "" }
: Search converges between 2002-10-15-trunk (#105) and 2002-10-16-trunk (#106).
Moving to 4.0.2 pre Mark.
Fixed at least on the mainline.
won't fix for GCC-4.0.x
Fixed.