stl_pair.h (pair<>::pair(const pair&)): Defaulted in C++0x mode.

2010-05-20  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/stl_pair.h (pair<>::pair(const pair&)): Defaulted
	in C++0x mode.
	(pair<>::operator=(const pair<>&)): Add in C++0x mode.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-error
	line number.

From-SVN: r159628
This commit is contained in:
Paolo Carlini 2010-05-20 14:08:53 +00:00 committed by Paolo Carlini
parent 5797be120a
commit ab6bfd90cb
3 changed files with 20 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/stl_pair.h (pair<>::pair(const pair&)): Defaulted
in C++0x mode.
(pair<>::operator=(const pair<>&)): Add in C++0x mode.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-error
line number.
2010-05-19 Jonathan Wakely <jwakely.gcc@gmail.com>
* testsuite/30_threads/future/members/wait.cc (wait): Rename.

View File

@ -98,6 +98,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
: first(__a), second(__b) { }
#ifdef __GXX_EXPERIMENTAL_CXX0X__
pair(const pair&) = default;
// DR 811.
template<class _U1, class = typename
std::enable_if<std::is_convertible<_U1, _T1>::value>::type>
@ -150,6 +152,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
return *this;
}
template<class _U1, class _U2>
pair&
operator=(const pair<_U1, _U2>& __p)
{
first = __p.first;
second = __p.second;
return *this;
}
template<class _U1, class _U2>
pair&
operator=(pair<_U1, _U2>&& __p)

View File

@ -48,4 +48,4 @@ main()
// { dg-warning "note" "" { target *-*-* } 1005 }
// { dg-warning "note" "" { target *-*-* } 340 }
// { dg-warning "note" "" { target *-*-* } 290 }
// { dg-warning "note" "" { target *-*-* } 190 }
// { dg-warning "note" "" { target *-*-* } 201 }