Implement P0848R3, Conditionally Trivial Special Member Functions.
authorJason Merrill <jason@redhat.com>
Thu, 15 Aug 2019 12:38:50 +0000 (08:38 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 15 Aug 2019 12:38:50 +0000 (08:38 -0400)
commitc735f8f1a0c5a5d1e114e45390b35882f539ff69
tree1ea2d4c11b3a6cdb3a137df04d979591a4e9277a
parent84cc60bf83e03267f5794a16b3eb83508a3196ce
Implement P0848R3, Conditionally Trivial Special Member Functions.

With Concepts, overloads of special member functions can differ in
constraints, and this paper clarifies how that affects class properties: if
a class has a more constrained trivial copy constructor and a less
constrained non-trivial copy constructor, it is still trivially copyable.

* tree.c (special_memfn_p): New.
* class.c (add_method): When overloading, hide ineligible special
member fns.
(check_methods): Set TYPE_HAS_COMPLEX_* here.
* decl.c (grok_special_member_properties): Not here.
* name-lookup.c (push_class_level_binding_1): Move overloaded
functions case down, accept FUNCTION_DECL as target_decl.

From-SVN: r274534
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/name-lookup.c
gcc/cp/tree.c
gcc/testsuite/g++.dg/concepts/pr89036.C
gcc/testsuite/g++.dg/cpp2a/cond-triv1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/cond-triv1a.C [new file with mode: 0644]