Commit 2dac37c0 by Jason Merrill Committed by Jason Merrill

PR c++/70709 - zero-length array member

	* class.c (walk_subobject_offsets): Handle 0-length array.

From-SVN: r238687
parent 71b3723a
2016-07-23 Jason Merrill <jason@redhat.com>
PR c++/70709
* class.c (walk_subobject_offsets): Handle 0-length array.
PR c++/70778
* pt.c (tsubst): Also substitute into the template of a
BOUND_TEMPLATE_TEMPLATE_PARM.
......
......@@ -4175,7 +4175,8 @@ walk_subobject_offsets (tree type,
/* Avoid recursing into objects that are not interesting. */
if (!CLASS_TYPE_P (element_type)
|| !CLASSTYPE_CONTAINS_EMPTY_CLASS_P (element_type)
|| !domain)
|| !domain
|| integer_minus_onep (TYPE_MAX_VALUE (domain)))
return 0;
/* Step through each of the elements in the array. */
......
// PR c++/70709
// { dg-options "" }
struct A
{
A (int);
};
struct B
{
B () {}
A a[0];
};
struct C
{
C () {}
B a[0];
};
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