Commit 70f961a5 by Jason Merrill Committed by Jason Merrill

re PR c++/46688 (g++ requires a function declaration when it should not)

	PR c++/46688
	* tree.c (build_vec_init_expr): Handle flexible array
	properly.

From-SVN: r168782
parent 8f66db3b
2011-01-14 Jason Merrill <jason@redhat.com>
PR c++/46688
* tree.c (build_vec_init_expr): Handle flexible array
properly.
2011-01-13 Kai Tietz <kai.tietz@onevision.com>
PR c++/47213
......
......@@ -474,7 +474,12 @@ build_vec_init_expr (tree type, tree init)
what functions are needed. Here we assume that init is either
NULL_TREE, void_type_node (indicating value-initialization), or
another array to copy. */
if (init == void_type_node)
if (integer_zerop (array_type_nelts_total (type)))
{
/* No actual initialization to do. */;
init = NULL_TREE;
}
else if (init == void_type_node)
{
elt_init = build_value_init (inner_type, tf_warning_or_error);
value_init = true;
......
2011-01-14 Jason Merrill <jason@redhat.com>
* g++.dg/ext/flexary2.C: New.
2011-01-14 Richard Guenther <rguenther@suse.de>
PR middle-end/47281
......
// PR c++/46688
// { dg-options "" }
struct A {
A(int);
};
struct B {
B() {}
A a[];
};
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