summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-30 00:51:44 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-30 00:51:44 +0000
commitbde2eab67c0f63e6dcafc495585ee57d7d810adf (patch)
tree232413e607b8465ed633e240d607739a6cbba07c /libstdc++-v3
parent4973dd77b950e66499d7df25595f714609a69f7c (diff)
downloadgcc-bde2eab67c0f63e6dcafc495585ee57d7d810adf.tar.gz
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
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog4
-rw-r--r--libstdc++-v3/include/bits/unordered_map.h14
-rw-r--r--libstdc++-v3/include/bits/unordered_set.h14
3 files changed, 32 insertions, 0 deletions
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 <jason@redhat.com>
+ 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<std::pair<const _Key, _Tp> >(), __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<std::pair<const _Key, _Tp> >(), __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)) { }
@@ -258,6 +264,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
{ }
unordered_map&
+ operator=(const unordered_map& __x) = default;
+
+ unordered_map&
operator=(unordered_map&& __x)
{
// NB: DR 1204.
@@ -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)) { }
@@ -340,6 +351,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
{ }
unordered_multimap&
+ operator=(const unordered_multimap& __x) = default;
+
+ unordered_multimap&
operator=(unordered_multimap&& __x)
{
// NB: DR 1204.
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)) { }
@@ -251,6 +257,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
{ }
unordered_set&
+ operator=(const unordered_set& __x) = default;
+
+ unordered_set&
operator=(unordered_set&& __x)
{
// NB: DR 1204.
@@ -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)) { }
@@ -330,6 +341,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
{ }
unordered_multiset&
+ operator=(const unordered_multiset& __x) = default;
+
+ unordered_multiset&
operator=(unordered_multiset&& __x)
{
// NB: DR 1204.