Commit fdce1719 by Jakub Jelinek Committed by Jakub Jelinek

re PR c/52880 (-Woverride-init emitts unexpected error)

	PR c/52880
	* c-typeck.c (set_nonincremental_init,
	set_nonincremental_init_from_string): Pass true instead of false
	as IMPLICIT to add_pending_init.

	* gcc.dg/pr52880.c: New test.

From-SVN: r186808
parent 32397f22
2012-04-25 Jakub Jelinek <jakub@redhat.com>
PR c/52880
* c-typeck.c (set_nonincremental_init,
set_nonincremental_init_from_string): Pass true instead of false
as IMPLICIT to add_pending_init.
2012-04-25 Manuel López-Ibáñez <manu@gcc.gnu.org>
* c-typeck.c (pop_init_level): Improve diagnostics.
......
......@@ -7617,7 +7617,7 @@ set_nonincremental_init (struct obstack * braced_init_obstack)
FOR_EACH_CONSTRUCTOR_ELT (constructor_elements, ix, index, value)
{
add_pending_init (index, value, NULL_TREE, false,
add_pending_init (index, value, NULL_TREE, true,
braced_init_obstack);
}
constructor_elements = 0;
......@@ -7710,7 +7710,7 @@ set_nonincremental_init_from_string (tree str,
}
value = build_int_cst_wide (type, val[1], val[0]);
add_pending_init (purpose, value, NULL_TREE, false,
add_pending_init (purpose, value, NULL_TREE, true,
braced_init_obstack);
}
......
2012-04-25 Jakub Jelinek <jakub@redhat.com>
PR c/52880
* gcc.dg/pr52880.c: New test.
2012-04-25 Manuel López-Ibáñez <manu@gcc.gnu.org>
* gcc.dg/m-un-2.c: Update.
......
/* PR c/52880 */
/* { dg-do compile } */
/* { dg-options "-Woverride-init" } */
struct A { int a; int b; };
struct B { struct A c; int d, e; };
struct B f = { .c.a = 0, .e = 1, .d = 2, .c.b = 3 };
struct C { int g; int h; };
struct D { int i; struct C j; int k; };
struct D l = { .j.g = 0, .k = 1, .i = 2, .j.h = 3 };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment