Commit 08d6d8bb by Jason Merrill Committed by Jason Merrill

class.c (is_really_empty_class): A zero-length array is empty.

	* class.c (is_really_empty_class): A zero-length array is empty.
	An unnamed bit-field doesn't make a class non-empty.

From-SVN: r234916
parent 6512fa6d
2016-04-12 Jason Merrill <jason@redhat.com>
* class.c (is_really_empty_class): A zero-length array is empty.
An unnamed bit-field doesn't make a class non-empty.
2016-04-12 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/68722
......
......@@ -8406,12 +8406,15 @@ is_really_empty_class (tree type)
for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL
&& !DECL_ARTIFICIAL (field)
/* An unnamed bit-field is not a data member. */
&& (DECL_NAME (field) || !DECL_C_BIT_FIELD (field))
&& !is_really_empty_class (TREE_TYPE (field)))
return false;
return true;
}
else if (TREE_CODE (type) == ARRAY_TYPE)
return is_really_empty_class (TREE_TYPE (type));
return (integer_zerop (array_type_nelts_top (type))
|| is_really_empty_class (TREE_TYPE (type)));
return false;
}
......
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