Commit 712b39c5 by Mark Mitchell Committed by Mark Mitchell

re PR c++/19755 (-Wmissing-braces doesn't warn anymore)

	PR c++/19755
	* decl.c (reshape_init): Issue warnings about missing braces.

	PR c++/19755
	* g++.dg/warn/Wbraces1.C: New test.

From-SVN: r94882
parent fb4d77b3
2005-02-10 Mark Mitchell <mark@codesourcery.com>
PR c++/19755
* decl.c (reshape_init): Issue warnings about missing braces.
2005-02-11 Kazu Hirata <kazu@cs.umass.edu>
* cp-tree.def, except.c, ptree.c: Update copyright.
......
......@@ -4352,10 +4352,15 @@ reshape_init (tree type, tree *initp)
new_init = build_tree_list (TREE_PURPOSE (old_init), new_init);
}
/* If this was a brace-enclosed initializer and all of the
initializers were not used up, there is a problem. */
if (brace_enclosed_p && *initp)
error ("too many initializers for %qT", type);
/* If there are more initializers than necessary, issue a
diagnostic. */
if (*initp)
{
if (brace_enclosed_p)
error ("too many initializers for %qT", type);
else if (warn_missing_braces)
warning ("missing braces around initializer");
}
return new_init;
}
......
2005-02-11 Mark Mitchell <mark@codesourcery.com>
PR c++/19755
* g++.dg/warn/Wbraces1.C: New test.
2005-02-10 Richard Guenther <rguenth@gcc.gnu.org>
* gcc.dg/builtins-52.c: New testcase.
......
// PR c++/19755
// { dg-options "-Wmissing-braces" }
int a[2][2] = { 0, 1 , 2, 3 }; // { dg-warning "" }
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