Commit 3c3fa147 by Richard Stallman

(digest_init): Use TYPE_MAIN_VARIANT comparing type of inside_init.

(process_init_constructor): Warn about partly bracketed initializers.

From-SVN: r1875
parent b5b6ad46
......@@ -4603,7 +4603,8 @@ digest_init (type, init, tail, require_constant, constructor_constant, ofwhat)
from an expression of the same type, optionally with braces.
For an array, this is allowed only for a string constant. */
if (inside_init && (TREE_TYPE (inside_init) == type
if (inside_init
&& (TYPE_MAIN_VARIANT (TREE_TYPE (inside_init)) == TYPE_MAIN_VARIANT (type)
|| (code == ARRAY_TYPE && TREE_TYPE (inside_init)
&& comptypes (TREE_TYPE (inside_init), type))
|| (code == POINTER_TYPE
......@@ -4867,7 +4868,11 @@ process_init_constructor (type, init, elts, constant_value, constant_element,
no matter how the data was given to us. */
if (elts)
{
if (extra_warnings)
warning ("aggregate has a partly bracketed initializer");
tail = *elts;
}
else
tail = CONSTRUCTOR_ELTS (init);
......
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