From bde2eab67c0f63e6dcafc495585ee57d7d810adf Mon Sep 17 00:00:00 2001 From: jason Date: Wed, 30 Jun 2010 00:51:44 +0000 Subject: Enable implicitly declared move constructor/operator= (N3053). gcc/cp/ * class.c (add_implicitly_declared_members): A class with no explicitly declared copy or move constructor gets both declared implicitly, and similarly for operator=. (check_bases): A type with no copy ctor does not inhibit a const copy ctor in a derived class. (check_field_decl): Likewise. (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial. * tree.c (type_has_nontrivial_copy_init): Adjust semantics. (trivially_copyable_p): Likewise. * call.c (convert_like_real): Use type_has_nontrivial_copy_init. * class.c (finish_struct_bits): Likewise. * tree.c (build_target_expr_with_type): Likewise. * typeck2.c (store_init_value): Likewise. libstdc++-v3/ * include/bits/unordered_map.h: Explicitly default copy constructors. * include/bits/unordered_set.h: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161582 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 4 ++++ libstdc++-v3/include/bits/unordered_map.h | 14 ++++++++++++++ libstdc++-v3/include/bits/unordered_set.h | 14 ++++++++++++++ 3 files changed, 32 insertions(+) (limited to 'libstdc++-v3') diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 5e0ebf832b1..dfb651e96a1 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,9 @@ 2010-06-29 Jason Merrill + Enable implicitly declared move constructor/operator= (N3053). + * include/bits/unordered_map.h: Explicitly default copy constructors. + * include/bits/unordered_set.h: Likewise. + * 19_diagnostics/error_category/cons/copy_neg.cc: Adjust expected errors, use dg-prune-output. * 20_util/function/cmp/cmp_neg.cc: Likewise. diff --git a/libstdc++-v3/include/bits/unordered_map.h b/libstdc++-v3/include/bits/unordered_map.h index 74998ff7725..80b970c8cf5 100644 --- a/libstdc++-v3/include/bits/unordered_map.h +++ b/libstdc++-v3/include/bits/unordered_map.h @@ -82,6 +82,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) __eql, std::_Select1st >(), __a) { } + __unordered_map(const __unordered_map& __x) = default; + __unordered_map(__unordered_map&& __x) : _Base(std::forward<_Base>(__x)) { } }; @@ -137,6 +139,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) __eql, std::_Select1st >(), __a) { } + __unordered_multimap(const __unordered_multimap& __x) = default; + __unordered_multimap(__unordered_multimap&& __x) : _Base(std::forward<_Base>(__x)) { } }; @@ -246,6 +250,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) : _Base(__f, __l, __n, __hf, __eql, __a) { } + unordered_map(const unordered_map& __x) = default; + unordered_map(unordered_map&& __x) : _Base(std::forward<_Base>(__x)) { } @@ -257,6 +263,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a) { } + unordered_map& + operator=(const unordered_map& __x) = default; + unordered_map& operator=(unordered_map&& __x) { @@ -328,6 +337,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) : _Base(__f, __l, __n, __hf, __eql, __a) { } + unordered_multimap(const unordered_multimap& __x) = default; + unordered_multimap(unordered_multimap&& __x) : _Base(std::forward<_Base>(__x)) { } @@ -339,6 +350,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a) { } + unordered_multimap& + operator=(const unordered_multimap& __x) = default; + unordered_multimap& operator=(unordered_multimap&& __x) { diff --git a/libstdc++-v3/include/bits/unordered_set.h b/libstdc++-v3/include/bits/unordered_set.h index 50dee215e16..8682f2d7237 100644 --- a/libstdc++-v3/include/bits/unordered_set.h +++ b/libstdc++-v3/include/bits/unordered_set.h @@ -82,6 +82,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) std::_Identity<_Value>(), __a) { } + __unordered_set(const __unordered_set& __x) = default; + __unordered_set(__unordered_set&& __x) : _Base(std::forward<_Base>(__x)) { } }; @@ -135,6 +137,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) std::_Identity<_Value>(), __a) { } + __unordered_multiset(const __unordered_multiset& __x) = default; + __unordered_multiset(__unordered_multiset&& __x) : _Base(std::forward<_Base>(__x)) { } }; @@ -239,6 +243,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) : _Base(__f, __l, __n, __hf, __eql, __a) { } + unordered_set(const unordered_set& __x) = default; + unordered_set(unordered_set&& __x) : _Base(std::forward<_Base>(__x)) { } @@ -250,6 +256,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a) { } + unordered_set& + operator=(const unordered_set& __x) = default; + unordered_set& operator=(unordered_set&& __x) { @@ -318,6 +327,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) : _Base(__f, __l, __n, __hf, __eql, __a) { } + unordered_multiset(const unordered_multiset& __x) = default; + unordered_multiset(unordered_multiset&& __x) : _Base(std::forward<_Base>(__x)) { } @@ -329,6 +340,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) : _Base(__l.begin(), __l.end(), __n, __hf, __eql, __a) { } + unordered_multiset& + operator=(const unordered_multiset& __x) = default; + unordered_multiset& operator=(unordered_multiset&& __x) { -- cgit v1.2.1