* decl2.c (constrain_class_visibility): Don't warn about artificial
fields.
From-SVN: r254973
+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
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);
--- /dev/null
+struct __attribute ((visibility ("hidden"))) A { int i; };
+struct B: A { }; // { dg-warning "base" }