Implement D1907R1 "structural type".
authorJason Merrill <jason@redhat.com>
Thu, 7 Nov 2019 00:50:19 +0000 (19:50 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 7 Nov 2019 00:50:19 +0000 (19:50 -0500)
commit74fa38297b22d826f53f0b1894a1847eca3503dc
tree80dd4fe6801052da50c979452f37253d83c5496b
parent951c6f3dd975d795adc409da1a1477b5229199ae
Implement D1907R1 "structural type".

ISO C++ paper D1907R1 proposes "structural type" as an alternative to the
current notion of "strong structural equality", which has various problems.
I'm implementing it to give people a chance to try it.

The build_base_field changes are to make it easier for structural_type_p to
see whether a base is private or protected.

* tree.c (structural_type_p): New.
* pt.c (invalid_nontype_parm_type_p): Use it.
* class.c (build_base_field_1): Take binfo.  Copy TREE_PRIVATE.
(build_base_field): Pass binfo.

From-SVN: r277902
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/pt.c
gcc/cp/tree.c
gcc/testsuite/g++.dg/cpp2a/udlit-class-nttp-neg2.C