diff options
author | Jason Merrill <jason@redhat.com> | 2017-11-20 17:37:45 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2017-11-20 17:37:45 -0500 |
commit | 753c2e693fd35b582b34e66ac877cd1a4a385be7 (patch) | |
tree | e66a86164272ab68bb596ec52269d2a4674ce924 /gcc/cp | |
parent | e324f9cb921234b80c809f8ffbd7ef2d55d583bc (diff) | |
download | gcc-753c2e693fd35b582b34e66ac877cd1a4a385be7.zip gcc-753c2e693fd35b582b34e66ac877cd1a4a385be7.tar.gz gcc-753c2e693fd35b582b34e66ac877cd1a4a385be7.tar.bz2 |
Avoid duplicate visibility warning.
* decl2.c (constrain_class_visibility): Don't warn about artificial
fields.
From-SVN: r254973
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 31b20ff..5de732f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +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 diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index bc0db00..13e7b1d 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -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); |