* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166525
138bc75d-0d04-0410-961f-
82ee72b054a4
+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>
Johannes Singler <singler@kit.edu>
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-error
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>
* doc/doxygen/user.cfg.in: Adjust scanned includes.
// Constructors.
constexpr unique_ptr()
: _M_t()
- { }
+ { static_assert(!std::is_pointer<deleter_type>::value,
+ "constructed with null function pointer deleter"); }
explicit
unique_ptr(pointer __p)
constexpr unique_ptr(nullptr_t)
: _M_t()
- { }
+ { static_assert(!std::is_pointer<deleter_type>::value,
+ "constructed with null function pointer deleter"); }
// Move constructors.
unique_ptr(unique_ptr&& __u)
// Constructors.
constexpr unique_ptr()
: _M_t()
- { }
+ { static_assert(!std::is_pointer<deleter_type>::value,
+ "constructed with null function pointer deleter"); }
explicit
unique_ptr(pointer __p)
{ static_assert(!std::is_reference<deleter_type>::value,
"rvalue deleter bound to reference"); }
- /* TODO: use delegating constructor */
constexpr unique_ptr(nullptr_t)
: _M_t()
- { }
+ { static_assert(!std::is_pointer<deleter_type>::value,
+ "constructed with null function pointer deleter"); }
// Move constructors.
unique_ptr(unique_ptr&& __u)
void
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" }
}
void
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" }
}
// { dg-warning "note" "" { target *-*-* } 350 }
// { dg-warning "note" "" { target *-*-* } 1082 }
-// { dg-warning "note" "" { target *-*-* } 462 }
+// { dg-warning "note" "" { target *-*-* } 465 }
// { dg-warning "note" "" { target *-*-* } 580 }
// { dg-warning "note" "" { target *-*-* } 1027 }
// { dg-warning "note" "" { target *-*-* } 340 }