diff options
author | Jason Merrill <jason@redhat.com> | 2019-08-15 08:38:50 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2019-08-15 08:38:50 -0400 |
commit | c735f8f1a0c5a5d1e114e45390b35882f539ff69 (patch) | |
tree | 1ea2d4c11b3a6cdb3a137df04d979591a4e9277a /gcc/cp/name-lookup.c | |
parent | 84cc60bf83e03267f5794a16b3eb83508a3196ce (diff) | |
download | gcc-c735f8f1a0c5a5d1e114e45390b35882f539ff69.zip gcc-c735f8f1a0c5a5d1e114e45390b35882f539ff69.tar.gz gcc-c735f8f1a0c5a5d1e114e45390b35882f539ff69.tar.bz2 |
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
Diffstat (limited to 'gcc/cp/name-lookup.c')
-rw-r--r-- | gcc/cp/name-lookup.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 16c7428..5f5ff81 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4504,9 +4504,6 @@ push_class_level_binding_1 (tree name, tree x) binding->type = NULL_TREE; } } - else if (TREE_CODE (target_decl) == OVERLOAD - && OVL_P (target_bval)) - old_decl = bval; else if (TREE_CODE (decl) == USING_DECL && TREE_CODE (bval) == USING_DECL && same_type_p (USING_DECL_SCOPE (decl), @@ -4525,6 +4522,9 @@ push_class_level_binding_1 (tree name, tree x) else if (TREE_CODE (bval) == USING_DECL && OVL_P (target_decl)) return true; + else if (OVL_P (target_decl) + && OVL_P (target_bval)) + old_decl = bval; if (old_decl && binding->scope == class_binding_level) { |