+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.
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.
--- /dev/null
+// PR c++/19755
+// { dg-options "-Wmissing-braces" }
+int a[2][2] = { 0, 1 , 2, 3 }; // { dg-warning "" }