1 // { dg-do run { target c++11 } }
5 #include <testsuite_hooks.h>
7 template<typename T
, typename Seq
>
9 check(std::priority_queue
<T
, Seq
>& p
)
26 // A vector-like type that has a non-empty moved-from state.
27 struct Vector
: std::vector
<int>
29 using Base
= std::vector
<int>;
33 Vector(const Vector
&) = default;
34 Vector
& operator=(const Vector
&) = default;
36 Vector(Vector
&& v
) : Base(static_cast<const Base
&>(v
))
41 Vector(Vector
&& v
, const std::allocator
<int>&)
42 : Base(static_cast<const Base
&>(v
))
50 static_cast<Base
&>(*this) = static_cast<const Base
&>(v
);
55 void invalidate_heap(Base
& v
) { v
= {1,2,3}; }
61 std::priority_queue
<int, Vector
> p
;
69 std::priority_queue
<int, Vector
> p2
= std::move(p
);
72 // Allocator-extended move constructor:
73 std::priority_queue
<int, Vector
> p3(std::move(p2
), std::allocator
<int>());