unique_ptr.h (unique_ptr<>::get_deleter): Simplify return type.

2010-03-03  Paolo Carlini  <paolo.carlini@oracle.com>
	    Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/bits/unique_ptr.h (unique_ptr<>::get_deleter): Simplify
	return type.
	* testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Adjust
	dg-error line number.
	* testsuite/20_util/unique_ptr/assign/assign_neg.cc: Likewise.

Co-Authored-By: Jonathan Wakely <jwakely.gcc@gmail.com>

From-SVN: r157193
This commit is contained in:
Paolo Carlini 2010-03-03 11:06:59 +00:00 committed by Paolo Carlini
parent bef7d288df
commit 2ba34efc55
4 changed files with 16 additions and 11 deletions

View File

@ -1,3 +1,12 @@
2010-03-03 Paolo Carlini <paolo.carlini@oracle.com>
Jonathan Wakely <jwakely.gcc@gmail.com>
* include/bits/unique_ptr.h (unique_ptr<>::get_deleter): Simplify
return type.
* testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Adjust
dg-error line number.
* testsuite/20_util/unique_ptr/assign/assign_neg.cc: Likewise.
2010-03-02 Paolo Carlini <paolo.carlini@oracle.com>
* include/debug/bitset (hash): Minor tweaks.

View File

@ -167,13 +167,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
get() const
{ return std::get<0>(_M_t); }
typename std::add_lvalue_reference<deleter_type>::type
deleter_type&
get_deleter()
{ return std::get<1>(_M_t); }
typename std::add_lvalue_reference<
typename std::add_const<deleter_type>::type
>::type
const deleter_type&
get_deleter() const
{ return std::get<1>(_M_t); }
@ -300,13 +298,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
get() const
{ return std::get<0>(_M_t); }
typename std::add_lvalue_reference<deleter_type>::type
deleter_type&
get_deleter()
{ return std::get<1>(_M_t); }
typename std::add_lvalue_reference<
typename std::add_const<deleter_type>::type
>::type
const deleter_type&
get_deleter() const
{ return std::get<1>(_M_t); }

View File

@ -49,7 +49,7 @@ test03()
std::unique_ptr<int[2]> p2 = p1;
}
// { dg-error "deleted function" "" { target *-*-* } 346 }
// { dg-error "deleted function" "" { target *-*-* } 342 }
// { dg-error "used here" "" { target *-*-* } 42 }
// { dg-error "no matching" "" { target *-*-* } 48 }
// { dg-warning "candidates are" "" { target *-*-* } 115 }
@ -57,5 +57,5 @@ test03()
// { dg-warning "note" "" { target *-*-* } 103 }
// { dg-warning "note" "" { target *-*-* } 98 }
// { dg-warning "note" "" { target *-*-* } 92 }
// { dg-error "deleted function" "" { target *-*-* } 209 }
// { dg-error "deleted function" "" { target *-*-* } 207 }
// { dg-error "used here" "" { target *-*-* } 49 }

View File

@ -36,4 +36,4 @@ void test01()
}
// { dg-error "used here" "" { target *-*-* } 35 }
// { dg-error "deleted function" "" { target *-*-* } 336 }
// { dg-error "deleted function" "" { target *-*-* } 332 }