stl_deque.h (deque<>::operator=(deque&&)): Implement resolution of DR 675, call clear first.

2007-11-09  Paolo Carlini  <pcarlini@suse.de>

	* include/bits/stl_deque.h (deque<>::operator=(deque&&)): Implement
	resolution of DR 675, call clear first.
	* include/bits/stl_list.h (list<>::operator=(list&&)): Likewise.
	* include/bits/stl_bvector.h (vector<bool>::operator=(vector&&)):
	Likewise.
	* include/bits/stl_vector.h (vector<>::operator=(vector&&)): Likewise.
	* include/bits/stl_map.h (map<>::operator=(map&&)): Likewise.
	* include/bits/stl_multimap.h (multimap<>::operator=(multimap&&)):
	Likewise.
	* include/bits/stl_multiset.h (multiset<>::operator=(multiset&&)):
	Likewise.
	* include/bits/stl_set.h (set<>::operator=(set&&)): Likewise.
	* include/debug/map.h (map<>::operator=(map&&)): Likewise.
	* include/debug/set.h (set<>::operator=(set&&)): Likewise.
	* include/debug/multimap.h (multimap<>::operator=(multimap&&)):
	Likewise.
	* include/debug/multiset.h (multiset<>::operator=(multiset&&)):
	Likewise.
	* include/debug/deque (deque<>::operator=(deque&&)): Likewise.
	* include/debug/list (list<>::operator=(list&&)): Likewise. 
	* include/debug/vector (vector<>::operator=(vector&&)): Likewise.
	* testsuite/23_containers/multimap/moveable.cc: Adjust.
	* testsuite/23_containers/multiset/moveable.cc: Likewise.
	* testsuite/23_containers/set/moveable.cc: Likewise.
	* testsuite/23_containers/map/moveable.cc: Likewise.
	* testsuite/20_util/pair/moveable.cc: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
	Adjust dg-error line numbers.
	* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/deque/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/
	constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/list/requirements/dr438/
	constructor_2_neg.cc: Likewise.
 	* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/
	constructor_2_neg.cc: Likewise.

From-SVN: r130051
This commit is contained in:
Paolo Carlini 2007-11-09 17:18:10 +00:00 committed by Paolo Carlini
parent ac4a7e21ca
commit cbc6c888f9
33 changed files with 102 additions and 19 deletions

View File

@ -1,3 +1,56 @@
2007-11-09 Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_deque.h (deque<>::operator=(deque&&)): Implement
resolution of DR 675, call clear first.
* include/bits/stl_list.h (list<>::operator=(list&&)): Likewise.
* include/bits/stl_bvector.h (vector<bool>::operator=(vector&&)):
Likewise.
* include/bits/stl_vector.h (vector<>::operator=(vector&&)): Likewise.
* include/bits/stl_map.h (map<>::operator=(map&&)): Likewise.
* include/bits/stl_multimap.h (multimap<>::operator=(multimap&&)):
Likewise.
* include/bits/stl_multiset.h (multiset<>::operator=(multiset&&)):
Likewise.
* include/bits/stl_set.h (set<>::operator=(set&&)): Likewise.
* include/debug/map.h (map<>::operator=(map&&)): Likewise.
* include/debug/set.h (set<>::operator=(set&&)): Likewise.
* include/debug/multimap.h (multimap<>::operator=(multimap&&)):
Likewise.
* include/debug/multiset.h (multiset<>::operator=(multiset&&)):
Likewise.
* include/debug/deque (deque<>::operator=(deque&&)): Likewise.
* include/debug/list (list<>::operator=(list&&)): Likewise.
* include/debug/vector (vector<>::operator=(vector&&)): Likewise.
* testsuite/23_containers/multimap/moveable.cc: Adjust.
* testsuite/23_containers/multiset/moveable.cc: Likewise.
* testsuite/23_containers/set/moveable.cc: Likewise.
* testsuite/23_containers/map/moveable.cc: Likewise.
* testsuite/20_util/pair/moveable.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
Adjust dg-error line numbers.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Likewise.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Likewise.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Likewise.
2007-11-09 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/34032

View File

@ -560,7 +560,9 @@ template<typename _Alloc>
#ifdef __GXX_EXPERIMENTAL_CXX0X__
vector&
operator=(vector&& __x)
{
{
// NB: DR 675.
this->clear();
this->swap(__x);
return *this;
}

View File

@ -808,6 +808,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
deque&
operator=(deque&& __x)
{
// NB: DR 675.
this->clear();
this->swap(__x);
return *this;
}

View File

@ -582,6 +582,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
list&
operator=(list&& __x)
{
// NB: DR 675.
this->clear();
this->swap(__x);
return *this;
}

View File

@ -255,6 +255,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
map&
operator=(map&& __x)
{
// NB: DR 675.
this->clear();
this->swap(__x);
return *this;
}

View File

@ -253,6 +253,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
multimap&
operator=(multimap&& __x)
{
// NB: DR 675.
this->clear();
this->swap(__x);
return *this;
}

View File

@ -225,6 +225,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
multiset&
operator=(multiset&& __x)
{
// NB: DR 675.
this->clear();
this->swap(__x);
return *this;
}

View File

@ -232,6 +232,8 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
set&
operator=(set&& __x)
{
// NB: DR 675.
this->clear();
this->swap(__x);
return *this;
}

View File

@ -325,7 +325,9 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
*/
vector&
operator=(vector&& __x)
{
{
// NB: DR 675.
this->clear();
this->swap(__x);
return *this;
}

View File

@ -110,6 +110,8 @@ namespace __debug
deque&
operator=(deque&& __x)
{
// NB: DR 675.
clear();
swap(__x);
return *this;
}

View File

@ -139,6 +139,8 @@ namespace __debug
list&
operator=(list&& __x)
{
// NB: DR 675.
clear();
swap(__x);
return *this;
}

View File

@ -114,6 +114,8 @@ namespace __debug
map&
operator=(map&& __x)
{
// NB: DR 675.
clear();
swap(__x);
return *this;
}

View File

@ -115,6 +115,8 @@ namespace __debug
multimap&
operator=(multimap&& __x)
{
// NB: DR 675.
clear();
swap(__x);
return *this;
}

View File

@ -112,6 +112,8 @@ namespace __debug
multiset&
operator=(multiset&& __x)
{
// NB: DR 675.
clear();
swap(__x);
return *this;
}

View File

@ -112,6 +112,8 @@ namespace __debug
set&
operator=(set&& __x)
{
// NB: DR 675.
clear();
swap(__x);
return *this;
}

View File

@ -123,6 +123,8 @@ namespace __debug
vector&
operator=(vector&& __x)
{
// NB: DR 675.
clear();
swap(__x);
return *this;
}

View File

@ -58,7 +58,7 @@ test2()
std::pair<int, std::vector<int> > q = make_pair(2,w);
p = std::move(q);
VERIFY(p.first == 2 && q.first == 2 &&
p.second.size() == 2 && q.second.size() == 1);
p.second.size() == 2 && q.second.size() == 0);
std::pair<int, std::vector<int> > r(std::move(p));
VERIFY(r.first == 2 && p.first == 2 &&
r.second.size() == 2 && p.second.size() == 0);

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1400 }
// { dg-error "no matching" "" { target *-*-* } 1402 }
// { dg-excess-errors "" }
#include <deque>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1335 }
// { dg-error "no matching" "" { target *-*-* } 1337 }
// { dg-excess-errors "" }
#include <deque>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1335 }
// { dg-error "no matching" "" { target *-*-* } 1337 }
// { dg-excess-errors "" }
#include <deque>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1480 }
// { dg-error "no matching" "" { target *-*-* } 1482 }
// { dg-excess-errors "" }
#include <deque>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1234 }
// { dg-error "no matching" "" { target *-*-* } 1236 }
// { dg-excess-errors "" }
#include <list>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1203 }
// { dg-error "no matching" "" { target *-*-* } 1205 }
// { dg-excess-errors "" }
#include <list>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1203 }
// { dg-error "no matching" "" { target *-*-* } 1205 }
// { dg-excess-errors "" }
#include <list>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1203 }
// { dg-error "no matching" "" { target *-*-* } 1205 }
// { dg-excess-errors "" }
#include <list>

View File

@ -43,7 +43,7 @@ int main()
a[2]=0;
b[1]=0;
b = std::move(a);
VERIFY(b.find(2) != b.end() && a.find(1) != a.end());
VERIFY(b.find(2) != b.end() && a.find(1) == a.end());
std::map<int, int> c(std::move(b));
VERIFY( c.find(2) != c.end());

View File

@ -43,7 +43,7 @@ int main()
a.insert(std::make_pair(2,0));
b.insert(std::make_pair(1,0));
b = std::move(a);
VERIFY(b.find(2) != b.end() && a.find(1) != a.end());
VERIFY(b.find(2) != b.end() && a.find(1) == a.end());
std::multimap<int, int> c(std::move(b));
VERIFY( c.find(2) != c.end());

View File

@ -43,7 +43,7 @@ int main()
a.insert(2);
b.insert(1);
b = std::move(a);
VERIFY(b.find(2) != b.end() && a.find(1) != a.end());
VERIFY(b.find(2) != b.end() && a.find(1) == a.end());
std::multiset<int> c(std::move(b));
VERIFY( c.find(2) != c.end());

View File

@ -43,7 +43,7 @@ int main()
a.insert(2);
b.insert(1);
b = std::move(a);
VERIFY(b.find(2) != b.end() && a.find(1) != a.end());
VERIFY(b.find(2) != b.end() && a.find(1) == a.end());
std::set<int> c(std::move(b));
VERIFY( c.find(2) != c.end());

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 995 }
// { dg-error "no matching" "" { target *-*-* } 997 }
// { dg-excess-errors "" }
#include <vector>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 935 }
// { dg-error "no matching" "" { target *-*-* } 937 }
// { dg-excess-errors "" }
#include <vector>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 935 }
// { dg-error "no matching" "" { target *-*-* } 937 }
// { dg-excess-errors "" }
#include <vector>

View File

@ -19,7 +19,7 @@
// USA.
// { dg-do compile }
// { dg-error "no matching" "" { target *-*-* } 1036 }
// { dg-error "no matching" "" { target *-*-* } 1038 }
// { dg-excess-errors "" }
#include <vector>