+2017-04-26 Jonathan Wakely <jwakely@redhat.com>
+
+ * testsuite/23_containers/deque/allocator/move_assign-2.cc: Improve
+ comment. Ensure first test works because allocator type propagates and
+ not because is_always_equal is true.
+ * testsuite/23_containers/vector/52591.cc: Likewise. Restore original
+ testcase that instantiates the move-assignment operator.
+
2017-04-24 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/80506
#include <type_traits>
-// As an extension we allow move-assignment of std::deque when the element
-// type is not MoveAssignable, as long as the allocator type propagates or
-// is known to always compare equal.
+// Move-assignment of std::deque<T> is allowed for non-MoveAssignable T when
+// the allocator type propagates. As an extension we also allow it if the
+// allocator type is known to always compare equal.
struct C
{
template<typename U> A1(const A1<U>&) { }
using propagate_on_container_move_assignment = std::true_type;
+ using is_always_equal = std::false_type;
};
void test01()
#include <memory>
#include <type_traits>
-// As an extension we allow move-assignment of std::vector when the element
-// type is not MoveAssignable, as long as the allocator type propagates or
-// is known to always compare equal.
+// Move-assignment of std::vector<T> is allowed for non-MoveAssignable T when
+// the allocator type propagates. As an extension we also allow it if the
+// allocator type is known to always compare equal.
struct C
{
C& operator=(C&&) = delete;
};
+void test01()
+{
+ std::vector<C> a;
+ a = std::vector<C>();
+}
+
template<typename T>
struct A1 : std::allocator<T>
{
template<typename U> A1(const A1<U>&) { }
using propagate_on_container_move_assignment = std::true_type;
+ using is_always_equal = std::false_type;
};
-void test01()
+void test02()
{
using test_type = std::vector<C, A1<C>>;
static_assert(std::is_nothrow_move_assignable<test_type>::value,
using is_always_equal = std::true_type;
};
-void test02()
+void test03()
{
using test_type = std::vector<C, A2<C>>;
static_assert(std::is_nothrow_move_assignable<test_type>::value,