Commit 753c2e69 by Jason Merrill Committed by Jason Merrill

Avoid duplicate visibility warning.

	* decl2.c (constrain_class_visibility): Don't warn about artificial
	fields.

From-SVN: r254973
parent e324f9cb
2017-11-20 Jason Merrill <jason@redhat.com>
* decl2.c (constrain_class_visibility): Don't warn about artificial
fields.
2017-11-20 Jakub Jelinek <jakub@redhat.com>
P0329R4: Designated Initialization
......
......@@ -2553,7 +2553,8 @@ constrain_class_visibility (tree type)
vis = VISIBILITY_INTERNAL;
for (t = TYPE_FIELDS (type); t; t = DECL_CHAIN (t))
if (TREE_CODE (t) == FIELD_DECL && TREE_TYPE (t) != error_mark_node)
if (TREE_CODE (t) == FIELD_DECL && TREE_TYPE (t) != error_mark_node
&& !DECL_ARTIFICIAL (t))
{
tree ftype = strip_pointer_or_array_types (TREE_TYPE (t));
int subvis = type_visibility (ftype);
......
struct __attribute ((visibility ("hidden"))) A { int i; };
struct B: A { }; // { dg-warning "base" }
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