Fix C++20 structural type vs. private base.
authorJason Merrill <jason@redhat.com>
Tue, 10 Dec 2019 20:10:59 +0000 (15:10 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 10 Dec 2019 20:10:59 +0000 (15:10 -0500)
commit09b661cea17a144e68009ecdf61a92a05bf852dd
tree1b9cad92725bcc9fdcbf79f2494fde214906af93
parent1fb81d83a8857770be56df19c8a3b4e0ca87c71c
Fix C++20 structural type vs. private base.

In my patch to implement C++20 "structural type" I tried to set the access
flags on the artificial base fields appropriately, but failed.  I was
copying TREE_PRIVATE from the binfo, but TREE_PRIVATE on binfo is just a
temporary cache for dfs_access_in_type; we really need to get the
inheritance access information from BINFO_BASE_ACCESSES.

* class.c (build_base_field_1): Take access parameter.
(build_base_field): Likewise.
(build_base_fields, layout_virtual_bases): Pass it.
* tree.c (structural_type_p): Improve private base diagnostic.

From-SVN: r279184
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/tree.c
gcc/testsuite/g++.dg/cpp2a/nontype-class25.C [new file with mode: 0644]