unique_ptr.h: Use static_assert in constexpr constructors.
2010-11-10 Jonathan Wakely <jwakely.gcc@gmail.com> * include/bits/unique_ptr.h: Use static_assert in constexpr constructors. * testsuite/20_util/unique_ptr/cons/ptr_deleter_neg.cc: Remove xfails. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-error line number. From-SVN: r166525
This commit is contained in:
parent
c6dfaad54e
commit
ef40b37106
4 changed files with 28 additions and 10 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2010-11-10 Jonathan Wakely <jwakely.gcc@gmail.com>
|
||||||
|
|
||||||
|
* include/bits/unique_ptr.h: Use static_assert in constexpr
|
||||||
|
constructors.
|
||||||
|
* testsuite/20_util/unique_ptr/cons/ptr_deleter_neg.cc: Remove xfails.
|
||||||
|
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-error
|
||||||
|
line number.
|
||||||
|
|
||||||
2010-11-09 François Dumont <francois.cppdevs@free.fr>
|
2010-11-09 François Dumont <francois.cppdevs@free.fr>
|
||||||
Johannes Singler <singler@kit.edu>
|
Johannes Singler <singler@kit.edu>
|
||||||
|
|
||||||
|
@ -15,6 +23,13 @@
|
||||||
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-error
|
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-error
|
||||||
line number.
|
line number.
|
||||||
|
|
||||||
|
2010-11-08 Jonathan Wakely <jwakely.gcc@gmail.com>
|
||||||
|
|
||||||
|
* include/bits/unique_ptr.h: Move misplaced static_assert and use
|
||||||
|
tuple's constexpr constructor in constexpr constructors.
|
||||||
|
* testsuite/20_util/unique_ptr/cons/ptr_deleter.cc: New.
|
||||||
|
* testsuite/20_util/unique_ptr/cons/ptr_deleter_neg.cc: New.
|
||||||
|
|
||||||
2010-11-08 Benjamin Kosnik <bkoz@redhat.com>
|
2010-11-08 Benjamin Kosnik <bkoz@redhat.com>
|
||||||
|
|
||||||
* doc/doxygen/user.cfg.in: Adjust scanned includes.
|
* doc/doxygen/user.cfg.in: Adjust scanned includes.
|
||||||
|
|
|
@ -109,7 +109,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
// Constructors.
|
// Constructors.
|
||||||
constexpr unique_ptr()
|
constexpr unique_ptr()
|
||||||
: _M_t()
|
: _M_t()
|
||||||
{ }
|
{ static_assert(!std::is_pointer<deleter_type>::value,
|
||||||
|
"constructed with null function pointer deleter"); }
|
||||||
|
|
||||||
explicit
|
explicit
|
||||||
unique_ptr(pointer __p)
|
unique_ptr(pointer __p)
|
||||||
|
@ -130,7 +131,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
|
|
||||||
constexpr unique_ptr(nullptr_t)
|
constexpr unique_ptr(nullptr_t)
|
||||||
: _M_t()
|
: _M_t()
|
||||||
{ }
|
{ static_assert(!std::is_pointer<deleter_type>::value,
|
||||||
|
"constructed with null function pointer deleter"); }
|
||||||
|
|
||||||
// Move constructors.
|
// Move constructors.
|
||||||
unique_ptr(unique_ptr&& __u)
|
unique_ptr(unique_ptr&& __u)
|
||||||
|
@ -269,7 +271,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
// Constructors.
|
// Constructors.
|
||||||
constexpr unique_ptr()
|
constexpr unique_ptr()
|
||||||
: _M_t()
|
: _M_t()
|
||||||
{ }
|
{ static_assert(!std::is_pointer<deleter_type>::value,
|
||||||
|
"constructed with null function pointer deleter"); }
|
||||||
|
|
||||||
explicit
|
explicit
|
||||||
unique_ptr(pointer __p)
|
unique_ptr(pointer __p)
|
||||||
|
@ -288,10 +291,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
{ static_assert(!std::is_reference<deleter_type>::value,
|
{ static_assert(!std::is_reference<deleter_type>::value,
|
||||||
"rvalue deleter bound to reference"); }
|
"rvalue deleter bound to reference"); }
|
||||||
|
|
||||||
/* TODO: use delegating constructor */
|
|
||||||
constexpr unique_ptr(nullptr_t)
|
constexpr unique_ptr(nullptr_t)
|
||||||
: _M_t()
|
: _M_t()
|
||||||
{ }
|
{ static_assert(!std::is_pointer<deleter_type>::value,
|
||||||
|
"constructed with null function pointer deleter"); }
|
||||||
|
|
||||||
// Move constructors.
|
// Move constructors.
|
||||||
unique_ptr(unique_ptr&& __u)
|
unique_ptr(unique_ptr&& __u)
|
||||||
|
|
|
@ -30,9 +30,9 @@ using std::unique_ptr;
|
||||||
void
|
void
|
||||||
test01()
|
test01()
|
||||||
{
|
{
|
||||||
unique_ptr<int, void(*)(int*)> p1; // { dg-error "here" "" { xfail *-*-* } }
|
unique_ptr<int, void(*)(int*)> p1; // { dg-error "here" }
|
||||||
|
|
||||||
unique_ptr<int, void(*)(int*)> p2(nullptr); // { dg-error "here" "" { xfail *-*-* } }
|
unique_ptr<int, void(*)(int*)> p2(nullptr); // { dg-error "here" }
|
||||||
|
|
||||||
unique_ptr<int, void(*)(int*)> p3(new int); // { dg-error "here" }
|
unique_ptr<int, void(*)(int*)> p3(new int); // { dg-error "here" }
|
||||||
}
|
}
|
||||||
|
@ -40,9 +40,9 @@ test01()
|
||||||
void
|
void
|
||||||
test02()
|
test02()
|
||||||
{
|
{
|
||||||
unique_ptr<int[], void(*)(int*)> p1; // { dg-error "here" "" { xfail *-*-* } }
|
unique_ptr<int[], void(*)(int*)> p1; // { dg-error "here" }
|
||||||
|
|
||||||
unique_ptr<int[], void(*)(int*)> p2(nullptr); // { dg-error "here" "" { xfail *-*-* } }
|
unique_ptr<int[], void(*)(int*)> p2(nullptr); // { dg-error "here" }
|
||||||
|
|
||||||
unique_ptr<int[], void(*)(int*)> p3(new int[1]); // { dg-error "here" }
|
unique_ptr<int[], void(*)(int*)> p3(new int[1]); // { dg-error "here" }
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ main()
|
||||||
|
|
||||||
// { dg-warning "note" "" { target *-*-* } 350 }
|
// { dg-warning "note" "" { target *-*-* } 350 }
|
||||||
// { dg-warning "note" "" { target *-*-* } 1082 }
|
// { dg-warning "note" "" { target *-*-* } 1082 }
|
||||||
// { dg-warning "note" "" { target *-*-* } 462 }
|
// { dg-warning "note" "" { target *-*-* } 465 }
|
||||||
// { dg-warning "note" "" { target *-*-* } 580 }
|
// { dg-warning "note" "" { target *-*-* } 580 }
|
||||||
// { dg-warning "note" "" { target *-*-* } 1027 }
|
// { dg-warning "note" "" { target *-*-* } 1027 }
|
||||||
// { dg-warning "note" "" { target *-*-* } 340 }
|
// { dg-warning "note" "" { target *-*-* } 340 }
|
||||||
|
|
Loading…
Add table
Reference in a new issue