[libcxx-commits] [libcxx] 4d3b502 - [libc++][NFC] Format the scoped_allocator_adaptor tests
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jan 30 06:59:56 PST 2024
Author: Louis Dionne
Date: 2024-01-30T09:59:51-05:00
New Revision: 4d3b502704809c9605b9568c6feb2a2f0ca51907
URL: https://github.com/llvm/llvm-project/commit/4d3b502704809c9605b9568c6feb2a2f0ca51907
DIFF: https://github.com/llvm/llvm-project/commit/4d3b502704809c9605b9568c6feb2a2f0ca51907.diff
LOG: [libc++][NFC] Format the scoped_allocator_adaptor tests
Added:
Modified:
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_copy.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_move.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/copy.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/deduct.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/default.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.verify.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.verify.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/deallocate.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/destroy.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/inner_allocator.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/max_size.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/outer_allocator.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/select_on_container_copy_construction.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/allocator_pointers.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/inner_allocator_type.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/is_always_equal.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_copy_assignment.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_move_assignment.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_swap.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/copy_assign.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/eq.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/move_assign.pass.cpp
libcxx/test/std/utilities/allocator.adaptor/types.pass.cpp
Removed:
################################################################################
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp
index 2a9d7052eb655..a752dfd029eff 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp
@@ -23,97 +23,94 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- {
- typedef std::scoped_allocator_adaptor<A1<int>> A;
- A1<int> a3(3);
- A a(a3);
- assert(a.outer_allocator() == A1<int>(3));
- assert(a.inner_allocator() == a);
- assert(A1<int>::copy_called == true);
- assert(A1<int>::move_called == false);
- }
- A1<int>::copy_called = false;
- {
- typedef std::scoped_allocator_adaptor<A1<int>> A;
- A a(A1<int>(3));
- assert(a.outer_allocator() == A1<int>(3));
- assert(a.inner_allocator() == a);
- assert(A1<int>::copy_called == false);
- assert(A1<int>::move_called == true);
- }
- A1<int>::move_called = false;
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
- A1<int> a4(4);
- A a(a4, A2<int>(5));
- assert(A1<int>::copy_called == true);
- assert(A1<int>::move_called == false);
- assert(A2<int>::copy_called == true);
- assert(A2<int>::move_called == false);
- assert(a.outer_allocator() == A1<int>(4));
- assert(a.inner_allocator() == std::scoped_allocator_adaptor<A2<int>>(A2<int>(5)));
- }
- A1<int>::copy_called = false;
- A1<int>::move_called = false;
- A2<int>::copy_called = false;
- A2<int>::move_called = false;
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
- A a(A1<int>(4), A2<int>(5));
- assert(A1<int>::copy_called == false);
- assert(A1<int>::move_called == true);
- assert(A2<int>::copy_called == true);
- assert(A2<int>::move_called == false);
- assert(a.outer_allocator() == A1<int>(4));
- assert(a.inner_allocator() == std::scoped_allocator_adaptor<A2<int>>(A2<int>(5)));
- }
- A1<int>::copy_called = false;
- A1<int>::move_called = false;
- A2<int>::copy_called = false;
- A2<int>::move_called = false;
- A1<int>::move_called = false;
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
- A1<int> a4(4);
- A a(a4, A2<int>(5), A3<int>(6));
- assert(A1<int>::copy_called == true);
- assert(A1<int>::move_called == false);
- assert(A2<int>::copy_called == true);
- assert(A2<int>::move_called == false);
- assert(A3<int>::copy_called == true);
- assert(A3<int>::move_called == false);
- assert(a.outer_allocator() == A1<int>(4));
- assert((a.inner_allocator() ==
- std::scoped_allocator_adaptor<A2<int>, A3<int>>(A2<int>(5), A3<int>(6))));
- }
- A1<int>::copy_called = false;
- A1<int>::move_called = false;
- A2<int>::copy_called = false;
- A2<int>::move_called = false;
- A3<int>::copy_called = false;
- A3<int>::move_called = false;
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
- A a(A1<int>(4), A2<int>(5), A3<int>(6));
- assert(A1<int>::copy_called == false);
- assert(A1<int>::move_called == true);
- assert(A2<int>::copy_called == true);
- assert(A2<int>::move_called == false);
- assert(A3<int>::copy_called == true);
- assert(A3<int>::move_called == false);
- assert(a.outer_allocator() == A1<int>(4));
- assert((a.inner_allocator() ==
- std::scoped_allocator_adaptor<A2<int>, A3<int>>(A2<int>(5), A3<int>(6))));
- }
-// Test for LWG2782
- {
- static_assert(!std::is_convertible<A1<int>, A2<int>>::value, "");
- static_assert(!std::is_convertible<
- std::scoped_allocator_adaptor<A1<int>>,
- std::scoped_allocator_adaptor<A2<int>>>::value, "");
- }
+int main(int, char**) {
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>> A;
+ A1<int> a3(3);
+ A a(a3);
+ assert(a.outer_allocator() == A1<int>(3));
+ assert(a.inner_allocator() == a);
+ assert(A1<int>::copy_called == true);
+ assert(A1<int>::move_called == false);
+ }
+ A1<int>::copy_called = false;
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>> A;
+ A a(A1<int>(3));
+ assert(a.outer_allocator() == A1<int>(3));
+ assert(a.inner_allocator() == a);
+ assert(A1<int>::copy_called == false);
+ assert(A1<int>::move_called == true);
+ }
+ A1<int>::move_called = false;
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
+ A1<int> a4(4);
+ A a(a4, A2<int>(5));
+ assert(A1<int>::copy_called == true);
+ assert(A1<int>::move_called == false);
+ assert(A2<int>::copy_called == true);
+ assert(A2<int>::move_called == false);
+ assert(a.outer_allocator() == A1<int>(4));
+ assert(a.inner_allocator() == std::scoped_allocator_adaptor<A2<int>>(A2<int>(5)));
+ }
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A2<int>::copy_called = false;
+ A2<int>::move_called = false;
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
+ A a(A1<int>(4), A2<int>(5));
+ assert(A1<int>::copy_called == false);
+ assert(A1<int>::move_called == true);
+ assert(A2<int>::copy_called == true);
+ assert(A2<int>::move_called == false);
+ assert(a.outer_allocator() == A1<int>(4));
+ assert(a.inner_allocator() == std::scoped_allocator_adaptor<A2<int>>(A2<int>(5)));
+ }
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A2<int>::copy_called = false;
+ A2<int>::move_called = false;
+ A1<int>::move_called = false;
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ A1<int> a4(4);
+ A a(a4, A2<int>(5), A3<int>(6));
+ assert(A1<int>::copy_called == true);
+ assert(A1<int>::move_called == false);
+ assert(A2<int>::copy_called == true);
+ assert(A2<int>::move_called == false);
+ assert(A3<int>::copy_called == true);
+ assert(A3<int>::move_called == false);
+ assert(a.outer_allocator() == A1<int>(4));
+ assert((a.inner_allocator() == std::scoped_allocator_adaptor<A2<int>, A3<int>>(A2<int>(5), A3<int>(6))));
+ }
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A2<int>::copy_called = false;
+ A2<int>::move_called = false;
+ A3<int>::copy_called = false;
+ A3<int>::move_called = false;
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ A a(A1<int>(4), A2<int>(5), A3<int>(6));
+ assert(A1<int>::copy_called == false);
+ assert(A1<int>::move_called == true);
+ assert(A2<int>::copy_called == true);
+ assert(A2<int>::move_called == false);
+ assert(A3<int>::copy_called == true);
+ assert(A3<int>::move_called == false);
+ assert(a.outer_allocator() == A1<int>(4));
+ assert((a.inner_allocator() == std::scoped_allocator_adaptor<A2<int>, A3<int>>(A2<int>(5), A3<int>(6))));
+ }
+ // Test for LWG2782
+ {
+ static_assert(!std::is_convertible<A1<int>, A2<int>>::value, "");
+ static_assert(
+ !std::is_convertible< std::scoped_allocator_adaptor<A1<int>>, std::scoped_allocator_adaptor<A2<int>>>::value,
+ "");
+ }
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_copy.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_copy.pass.cpp
index 3145e443de1b5..c111a32bc7024 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_copy.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_copy.pass.cpp
@@ -23,48 +23,46 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- {
- typedef std::scoped_allocator_adaptor<A1<double>> B;
- typedef std::scoped_allocator_adaptor<A1<int>> A;
- B a1(A1<int>(3));
- A1<int>::copy_called = false;
- A1<int>::move_called = false;
- A a2 = a1;
- assert(A1<int>::copy_called == true);
- assert(a2 == a1);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<double>, A2<int>> B;
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
- B a1(A1<int>(4), A2<int>(5));
- A1<int>::copy_called = false;
- A1<int>::move_called = false;
- A2<int>::copy_called = false;
- A2<int>::move_called = false;
- A a2 = a1;
- assert(A1<int>::copy_called == true);
- assert(A2<int>::copy_called == true);
- assert(a2 == a1);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<double>, A2<int>, A3<int>> B;
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
- B a1(A1<int>(4), A2<int>(5), A3<int>(6));
- A1<int>::copy_called = false;
- A1<int>::move_called = false;
- A2<int>::copy_called = false;
- A2<int>::move_called = false;
- A3<int>::copy_called = false;
- A3<int>::move_called = false;
- A a2 = a1;
- assert(A1<int>::copy_called == true);
- assert(A2<int>::copy_called == true);
- assert(A3<int>::copy_called == true);
- assert(a2 == a1);
- }
-
+int main(int, char**) {
+ {
+ typedef std::scoped_allocator_adaptor<A1<double>> B;
+ typedef std::scoped_allocator_adaptor<A1<int>> A;
+ B a1(A1<int>(3));
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A a2 = a1;
+ assert(A1<int>::copy_called == true);
+ assert(a2 == a1);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<double>, A2<int>> B;
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
+ B a1(A1<int>(4), A2<int>(5));
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A2<int>::copy_called = false;
+ A2<int>::move_called = false;
+ A a2 = a1;
+ assert(A1<int>::copy_called == true);
+ assert(A2<int>::copy_called == true);
+ assert(a2 == a1);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<double>, A2<int>, A3<int>> B;
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ B a1(A1<int>(4), A2<int>(5), A3<int>(6));
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A2<int>::copy_called = false;
+ A2<int>::move_called = false;
+ A3<int>::copy_called = false;
+ A3<int>::move_called = false;
+ A a2 = a1;
+ assert(A1<int>::copy_called == true);
+ assert(A2<int>::copy_called == true);
+ assert(A3<int>::copy_called == true);
+ assert(a2 == a1);
+ }
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_move.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_move.pass.cpp
index c1af8f88f4491..7396a77412787 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_move.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/converting_move.pass.cpp
@@ -23,53 +23,52 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- {
- typedef std::scoped_allocator_adaptor<A1<double>> B;
- typedef std::scoped_allocator_adaptor<A1<int>> A;
- B a1(A1<int>(3));
- A1<int>::copy_called = false;
- A1<int>::move_called = false;
- A a2 = std::move(a1);
- assert(A1<int>::copy_called == false);
- assert(A1<int>::move_called == true);
- assert(a2 == a1);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<double>, A2<int>> B;
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
- B a1(A1<int>(4), A2<int>(5));
- A1<int>::copy_called = false;
- A1<int>::move_called = false;
- A2<int>::copy_called = false;
- A2<int>::move_called = false;
- A a2 = std::move(a1);
- assert(A1<int>::copy_called == false);
- assert(A1<int>::move_called == true);
- assert(A2<int>::copy_called == false);
- assert(A2<int>::move_called == true);
- assert(a2 == a1);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<double>, A2<int>, A3<int>> B;
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
- B a1(A1<int>(4), A2<int>(5), A3<int>(6));
- A1<int>::copy_called = false;
- A1<int>::move_called = false;
- A2<int>::copy_called = false;
- A2<int>::move_called = false;
- A3<int>::copy_called = false;
- A3<int>::move_called = false;
- A a2 = std::move(a1);
- assert(A1<int>::copy_called == false);
- assert(A1<int>::move_called == true);
- assert(A2<int>::copy_called == false);
- assert(A2<int>::move_called == true);
- assert(A3<int>::copy_called == false);
- assert(A3<int>::move_called == true);
- assert(a2 == a1);
- }
+int main(int, char**) {
+ {
+ typedef std::scoped_allocator_adaptor<A1<double>> B;
+ typedef std::scoped_allocator_adaptor<A1<int>> A;
+ B a1(A1<int>(3));
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A a2 = std::move(a1);
+ assert(A1<int>::copy_called == false);
+ assert(A1<int>::move_called == true);
+ assert(a2 == a1);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<double>, A2<int>> B;
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
+ B a1(A1<int>(4), A2<int>(5));
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A2<int>::copy_called = false;
+ A2<int>::move_called = false;
+ A a2 = std::move(a1);
+ assert(A1<int>::copy_called == false);
+ assert(A1<int>::move_called == true);
+ assert(A2<int>::copy_called == false);
+ assert(A2<int>::move_called == true);
+ assert(a2 == a1);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<double>, A2<int>, A3<int>> B;
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ B a1(A1<int>(4), A2<int>(5), A3<int>(6));
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A2<int>::copy_called = false;
+ A2<int>::move_called = false;
+ A3<int>::copy_called = false;
+ A3<int>::move_called = false;
+ A a2 = std::move(a1);
+ assert(A1<int>::copy_called == false);
+ assert(A1<int>::move_called == true);
+ assert(A2<int>::copy_called == false);
+ assert(A2<int>::move_called == true);
+ assert(A3<int>::copy_called == false);
+ assert(A3<int>::move_called == true);
+ assert(a2 == a1);
+ }
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/copy.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/copy.pass.cpp
index 15b56433c67bb..99fc77601a22e 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/copy.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/copy.pass.cpp
@@ -21,50 +21,49 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- {
- typedef std::scoped_allocator_adaptor<A1<int>> A;
- A a1(A1<int>(3));
- A1<int>::copy_called = false;
- A1<int>::move_called = false;
- A a2 = a1;
- assert(A1<int>::copy_called == true);
- assert(A1<int>::move_called == false);
- assert(a2 == a1);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
- A a1(A1<int>(4), A2<int>(5));
- A1<int>::copy_called = false;
- A1<int>::move_called = false;
- A2<int>::copy_called = false;
- A2<int>::move_called = false;
- A a2 = a1;
- assert(A1<int>::copy_called == true);
- assert(A1<int>::move_called == false);
- assert(A2<int>::copy_called == true);
- assert(A2<int>::move_called == false);
- assert(a2 == a1);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
- A a1(A1<int>(4), A2<int>(5), A3<int>(6));
- A1<int>::copy_called = false;
- A1<int>::move_called = false;
- A2<int>::copy_called = false;
- A2<int>::move_called = false;
- A3<int>::copy_called = false;
- A3<int>::move_called = false;
- A a2 = a1;
- assert(A1<int>::copy_called == true);
- assert(A1<int>::move_called == false);
- assert(A2<int>::copy_called == true);
- assert(A2<int>::move_called == false);
- assert(A3<int>::copy_called == true);
- assert(A3<int>::move_called == false);
- assert(a2 == a1);
- }
+int main(int, char**) {
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>> A;
+ A a1(A1<int>(3));
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A a2 = a1;
+ assert(A1<int>::copy_called == true);
+ assert(A1<int>::move_called == false);
+ assert(a2 == a1);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
+ A a1(A1<int>(4), A2<int>(5));
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A2<int>::copy_called = false;
+ A2<int>::move_called = false;
+ A a2 = a1;
+ assert(A1<int>::copy_called == true);
+ assert(A1<int>::move_called == false);
+ assert(A2<int>::copy_called == true);
+ assert(A2<int>::move_called == false);
+ assert(a2 == a1);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ A a1(A1<int>(4), A2<int>(5), A3<int>(6));
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A2<int>::copy_called = false;
+ A2<int>::move_called = false;
+ A3<int>::copy_called = false;
+ A3<int>::move_called = false;
+ A a2 = a1;
+ assert(A1<int>::copy_called == true);
+ assert(A1<int>::move_called == false);
+ assert(A2<int>::copy_called == true);
+ assert(A2<int>::move_called == false);
+ assert(A3<int>::copy_called == true);
+ assert(A3<int>::move_called == false);
+ assert(a2 == a1);
+ }
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/deduct.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/deduct.pass.cpp
index 2e1272105215e..97b6bbf1467f7 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/deduct.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/deduct.pass.cpp
@@ -19,46 +19,44 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- // Deduct from (const OuterAlloc&).
- {
- typedef A1<int> OuterAlloc;
- OuterAlloc outer(3);
- std::scoped_allocator_adaptor a(outer);
- ASSERT_SAME_TYPE(decltype(a), std::scoped_allocator_adaptor<OuterAlloc>);
- }
-
- // Deduct from (OuterAlloc&&).
- {
- typedef A1<int> OuterAlloc;
- std::scoped_allocator_adaptor a(OuterAlloc(3));
- ASSERT_SAME_TYPE(decltype(a), std::scoped_allocator_adaptor<OuterAlloc>);
- }
-
- // Deduct from (const OuterAlloc&, const InnerAlloc&).
- {
- typedef A1<int> OuterAlloc;
- typedef A2<int> InnerAlloc;
- OuterAlloc outer(3);
- InnerAlloc inner(4);
-
- std::scoped_allocator_adaptor a(outer, inner);
- ASSERT_SAME_TYPE(decltype(a), std::scoped_allocator_adaptor<OuterAlloc, InnerAlloc>);
- }
-
- // Deduct from (const OuterAlloc&, const InnerAlloc1&, InnerAlloc2&&).
- {
- typedef A1<int> OuterAlloc;
- typedef A2<int> InnerAlloc1;
- typedef A2<float> InnerAlloc2;
- OuterAlloc outer(3);
- InnerAlloc1 inner(4);
-
- std::scoped_allocator_adaptor a(outer, inner, InnerAlloc2(5));
- ASSERT_SAME_TYPE(
- decltype(a), std::scoped_allocator_adaptor<OuterAlloc, InnerAlloc1, InnerAlloc2>);
- }
+int main(int, char**) {
+ // Deduct from (const OuterAlloc&).
+ {
+ typedef A1<int> OuterAlloc;
+ OuterAlloc outer(3);
+ std::scoped_allocator_adaptor a(outer);
+ ASSERT_SAME_TYPE(decltype(a), std::scoped_allocator_adaptor<OuterAlloc>);
+ }
+
+ // Deduct from (OuterAlloc&&).
+ {
+ typedef A1<int> OuterAlloc;
+ std::scoped_allocator_adaptor a(OuterAlloc(3));
+ ASSERT_SAME_TYPE(decltype(a), std::scoped_allocator_adaptor<OuterAlloc>);
+ }
+
+ // Deduct from (const OuterAlloc&, const InnerAlloc&).
+ {
+ typedef A1<int> OuterAlloc;
+ typedef A2<int> InnerAlloc;
+ OuterAlloc outer(3);
+ InnerAlloc inner(4);
+
+ std::scoped_allocator_adaptor a(outer, inner);
+ ASSERT_SAME_TYPE(decltype(a), std::scoped_allocator_adaptor<OuterAlloc, InnerAlloc>);
+ }
+
+ // Deduct from (const OuterAlloc&, const InnerAlloc1&, InnerAlloc2&&).
+ {
+ typedef A1<int> OuterAlloc;
+ typedef A2<int> InnerAlloc1;
+ typedef A2<float> InnerAlloc2;
+ OuterAlloc outer(3);
+ InnerAlloc1 inner(4);
+
+ std::scoped_allocator_adaptor a(outer, inner, InnerAlloc2(5));
+ ASSERT_SAME_TYPE(decltype(a), std::scoped_allocator_adaptor<OuterAlloc, InnerAlloc1, InnerAlloc2>);
+ }
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/default.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/default.pass.cpp
index e9cca7fed4a2c..87fd6d70e0316 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/default.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/default.pass.cpp
@@ -21,39 +21,37 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- {
- typedef std::scoped_allocator_adaptor<A1<int>> A;
- A a;
- assert(a.outer_allocator() == A1<int>());
- assert(a.inner_allocator() == a);
- assert(A1<int>::copy_called == false);
- assert(A1<int>::move_called == false);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
- A a;
- assert(a.outer_allocator() == A1<int>());
- assert(a.inner_allocator() == std::scoped_allocator_adaptor<A2<int>>());
- assert(A1<int>::copy_called == false);
- assert(A1<int>::move_called == false);
- assert(A2<int>::copy_called == false);
- assert(A2<int>::move_called == false);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
- A a;
- assert(a.outer_allocator() == A1<int>());
- assert((a.inner_allocator() == std::scoped_allocator_adaptor<A2<int>, A3<int>>()));
- assert(A1<int>::copy_called == false);
- assert(A1<int>::move_called == false);
- assert(A2<int>::copy_called == false);
- assert(A2<int>::move_called == false);
- assert(A3<int>::copy_called == false);
- assert(A3<int>::move_called == false);
- }
-
+int main(int, char**) {
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>> A;
+ A a;
+ assert(a.outer_allocator() == A1<int>());
+ assert(a.inner_allocator() == a);
+ assert(A1<int>::copy_called == false);
+ assert(A1<int>::move_called == false);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
+ A a;
+ assert(a.outer_allocator() == A1<int>());
+ assert(a.inner_allocator() == std::scoped_allocator_adaptor<A2<int>>());
+ assert(A1<int>::copy_called == false);
+ assert(A1<int>::move_called == false);
+ assert(A2<int>::copy_called == false);
+ assert(A2<int>::move_called == false);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ A a;
+ assert(a.outer_allocator() == A1<int>());
+ assert((a.inner_allocator() == std::scoped_allocator_adaptor<A2<int>, A3<int>>()));
+ assert(A1<int>::copy_called == false);
+ assert(A1<int>::move_called == false);
+ assert(A2<int>::copy_called == false);
+ assert(A2<int>::move_called == false);
+ assert(A3<int>::copy_called == false);
+ assert(A3<int>::move_called == false);
+ }
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.pass.cpp
index 6bfa2d68cb0ce..d29ff8d94373f 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.pass.cpp
@@ -21,30 +21,28 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- {
- typedef std::scoped_allocator_adaptor<A1<int>> A;
- A a;
- A1<int>::allocate_called = false;
- assert(a.allocate(10) == (int*)10);
- assert(A1<int>::allocate_called == true);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
- A a;
- A1<int>::allocate_called = false;
- assert(a.allocate(10) == (int*)10);
- assert(A1<int>::allocate_called == true);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
- A a;
- A1<int>::allocate_called = false;
- assert(a.allocate(10) == (int*)10);
- assert(A1<int>::allocate_called == true);
- }
-
+int main(int, char**) {
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>> A;
+ A a;
+ A1<int>::allocate_called = false;
+ assert(a.allocate(10) == (int*)10);
+ assert(A1<int>::allocate_called == true);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
+ A a;
+ A1<int>::allocate_called = false;
+ assert(a.allocate(10) == (int*)10);
+ assert(A1<int>::allocate_called == true);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ A a;
+ A1<int>::allocate_called = false;
+ assert(a.allocate(10) == (int*)10);
+ assert(A1<int>::allocate_called == true);
+ }
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.verify.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.verify.cpp
index 6bd5f8041f853..2d7deef1d4a90 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.verify.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.verify.cpp
@@ -20,6 +20,6 @@
#include "allocators.h"
void f() {
- std::scoped_allocator_adaptor<A1<int>> a;
- a.allocate(10); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::scoped_allocator_adaptor<A1<int>> a;
+ a.allocate(10); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.pass.cpp
index 15ae008d1b8ef..1cba1366e47b0 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.pass.cpp
@@ -21,51 +21,50 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- {
- typedef std::scoped_allocator_adaptor<A1<int>> A;
- A a;
- A1<int>::allocate_called = false;
- assert(a.allocate(10, (const void*)0) == (int*)10);
- assert(A1<int>::allocate_called == true);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
- A a;
- A1<int>::allocate_called = false;
- assert(a.allocate(10, (const void*)10) == (int*)10);
- assert(A1<int>::allocate_called == true);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
- A a;
- A1<int>::allocate_called = false;
- assert(a.allocate(10, (const void*)20) == (int*)10);
- assert(A1<int>::allocate_called == true);
- }
+int main(int, char**) {
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>> A;
+ A a;
+ A1<int>::allocate_called = false;
+ assert(a.allocate(10, (const void*)0) == (int*)10);
+ assert(A1<int>::allocate_called == true);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
+ A a;
+ A1<int>::allocate_called = false;
+ assert(a.allocate(10, (const void*)10) == (int*)10);
+ assert(A1<int>::allocate_called == true);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ A a;
+ A1<int>::allocate_called = false;
+ assert(a.allocate(10, (const void*)20) == (int*)10);
+ assert(A1<int>::allocate_called == true);
+ }
- {
- typedef std::scoped_allocator_adaptor<A2<int>> A;
- A a;
- A2<int>::allocate_called = false;
- assert(a.allocate(10, (const void*)0) == (int*)0);
- assert(A2<int>::allocate_called == true);
- }
- {
- typedef std::scoped_allocator_adaptor<A2<int>, A2<int>> A;
- A a;
- A2<int>::allocate_called = false;
- assert(a.allocate(10, (const void*)10) == (int*)10);
- assert(A2<int>::allocate_called == true);
- }
- {
- typedef std::scoped_allocator_adaptor<A2<int>, A2<int>, A3<int>> A;
- A a;
- A2<int>::allocate_called = false;
- assert(a.allocate(10, (const void*)20) == (int*)20);
- assert(A2<int>::allocate_called == true);
- }
+ {
+ typedef std::scoped_allocator_adaptor<A2<int>> A;
+ A a;
+ A2<int>::allocate_called = false;
+ assert(a.allocate(10, (const void*)0) == (int*)0);
+ assert(A2<int>::allocate_called == true);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A2<int>, A2<int>> A;
+ A a;
+ A2<int>::allocate_called = false;
+ assert(a.allocate(10, (const void*)10) == (int*)10);
+ assert(A2<int>::allocate_called == true);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A2<int>, A2<int>, A3<int>> A;
+ A a;
+ A2<int>::allocate_called = false;
+ assert(a.allocate(10, (const void*)20) == (int*)20);
+ assert(A2<int>::allocate_called == true);
+ }
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.verify.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.verify.cpp
index 05588dffd4a8d..03be764391992 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.verify.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.verify.cpp
@@ -20,6 +20,7 @@
#include "allocators.h"
void f() {
- std::scoped_allocator_adaptor<A1<int>> a;
- a.allocate(10, (const void*)0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::scoped_allocator_adaptor<A1<int>> a;
+ a.allocate(10, (const void*)0);
+ // expected-warning at -1 {{ignoring return value of function declared with 'nodiscard' attribute}}
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp
index aa74bf5a8e889..9be59e3c6178b 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct.pass.cpp
@@ -22,192 +22,178 @@
#include "test_macros.h"
#include "allocators.h"
-struct B
-{
- static bool constructed;
-
- typedef A1<B> allocator_type;
-
- explicit B(std::allocator_arg_t, const allocator_type& a, int i)
- {
- assert(a.id() == 5);
- assert(i == 6);
- constructed = true;
- }
+struct B {
+ static bool constructed;
+
+ typedef A1<B> allocator_type;
+
+ explicit B(std::allocator_arg_t, const allocator_type& a, int i) {
+ assert(a.id() == 5);
+ assert(i == 6);
+ constructed = true;
+ }
};
bool B::constructed = false;
-struct C
-{
- static bool constructed;
+struct C {
+ static bool constructed;
- typedef std::scoped_allocator_adaptor<A2<C>> allocator_type;
+ typedef std::scoped_allocator_adaptor<A2<C>> allocator_type;
- explicit C(std::allocator_arg_t, const allocator_type& a, int i)
- {
- assert(a.id() == 7);
- assert(i == 8);
- constructed = true;
- }
+ explicit C(std::allocator_arg_t, const allocator_type& a, int i) {
+ assert(a.id() == 7);
+ assert(i == 8);
+ constructed = true;
+ }
};
bool C::constructed = false;
-struct D
-{
- static bool constructed;
+struct D {
+ static bool constructed;
- typedef std::scoped_allocator_adaptor<A2<D>> allocator_type;
+ typedef std::scoped_allocator_adaptor<A2<D>> allocator_type;
- explicit D(int i, int j, const allocator_type& a)
- {
- assert(i == 1);
- assert(j == 2);
- assert(a.id() == 3);
- constructed = true;
- }
+ explicit D(int i, int j, const allocator_type& a) {
+ assert(i == 1);
+ assert(j == 2);
+ assert(a.id() == 3);
+ constructed = true;
+ }
};
bool D::constructed = false;
-struct E
-{
- static bool constructed;
+struct E {
+ static bool constructed;
- typedef std::scoped_allocator_adaptor<A1<E>> allocator_type;
+ typedef std::scoped_allocator_adaptor<A1<E>> allocator_type;
- explicit E(int i, int j, const allocator_type& a)
- {
- assert(i == 1);
- assert(j == 2);
- assert(a.id() == 50);
- constructed = true;
- }
+ explicit E(int i, int j, const allocator_type& a) {
+ assert(i == 1);
+ assert(j == 2);
+ assert(a.id() == 50);
+ constructed = true;
+ }
};
bool E::constructed = false;
-struct F
-{
- static bool constructed;
-
- typedef std::scoped_allocator_adaptor<A2<F>> allocator_type;
-
- explicit F(int i, int j)
- {
- assert(i == 1);
- assert(j == 2);
- }
-
- explicit F(int i, int j, const allocator_type& a)
- {
- assert(i == 1);
- assert(j == 2);
- assert(a.id() == 50);
- constructed = true;
- }
+struct F {
+ static bool constructed;
+
+ typedef std::scoped_allocator_adaptor<A2<F>> allocator_type;
+
+ explicit F(int i, int j) {
+ assert(i == 1);
+ assert(j == 2);
+ }
+
+ explicit F(int i, int j, const allocator_type& a) {
+ assert(i == 1);
+ assert(j == 2);
+ assert(a.id() == 50);
+ constructed = true;
+ }
};
bool F::constructed = false;
-struct G
-{
- static bool constructed;
+struct G {
+ static bool constructed;
- typedef std::scoped_allocator_adaptor<std::allocator<G>> allocator_type;
+ typedef std::scoped_allocator_adaptor<std::allocator<G>> allocator_type;
- G(std::allocator_arg_t, allocator_type&&) { assert(false); }
- G(const allocator_type&) { constructed = true; }
+ G(std::allocator_arg_t, allocator_type&&) { assert(false); }
+ G(const allocator_type&) { constructed = true; }
};
bool G::constructed = false;
-int main(int, char**)
-{
-
- {
- typedef std::scoped_allocator_adaptor<A1<std::string>> A;
- A a;
- char buf[100];
- typedef std::string S;
- S* s = (S*)buf;
- a.construct(s, 4, 'c');
- assert(*s == "cccc");
- s->~S();
- }
-
- {
- typedef std::scoped_allocator_adaptor<A1<B>> A;
- A a(A1<B>(5));
- char buf[100];
- typedef B S;
- S* s = (S*)buf;
- a.construct(s, 6);
- assert(S::constructed);
- s->~S();
- }
-
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<C>> A;
- A a(A1<int>(5), A2<C>(7));
- char buf[100];
- typedef C S;
- S* s = (S*)buf;
- a.construct(s, 8);
- assert(S::constructed);
- s->~S();
- }
-
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<D>> A;
- A a(A1<int>(5), A2<D>(3));
- char buf[100];
- typedef D S;
- S* s = (S*)buf;
- a.construct(s, 1, 2);
- assert(S::constructed);
- s->~S();
- }
-
- {
- typedef std::scoped_allocator_adaptor<A3<E>, A2<E>> K;
- typedef std::scoped_allocator_adaptor<K, A1<E>> A;
- A a(K(), A1<E>(50));
- char buf[100];
- typedef E S;
- S* s = (S*)buf;
- A3<E>::constructed = false;
- a.construct(s, 1, 2);
- assert(S::constructed);
- assert(A3<E>::constructed);
- s->~S();
- }
-
- {
- typedef std::scoped_allocator_adaptor<A3<F>, A2<F>> K;
- typedef std::scoped_allocator_adaptor<K, A1<F>> A;
- A a(K(), A1<F>(50));
- char buf[100];
- typedef F S;
- S* s = (S*)buf;
- A3<F>::constructed = false;
- a.construct(s, 1, 2);
- assert(!S::constructed);
- assert(A3<F>::constructed);
- s->~S();
- }
-
- // LWG 2586
- // Test that is_constructible uses an lvalue ref so the correct constructor
- // is picked.
- {
- G::allocator_type sa;
- G* ptr = sa.allocate(1);
- sa.construct(ptr);
- assert(G::constructed);
- sa.deallocate(ptr, 1);
- }
+int main(int, char**) {
+ {
+ typedef std::scoped_allocator_adaptor<A1<std::string>> A;
+ A a;
+ char buf[100];
+ typedef std::string S;
+ S* s = (S*)buf;
+ a.construct(s, 4, 'c');
+ assert(*s == "cccc");
+ s->~S();
+ }
+
+ {
+ typedef std::scoped_allocator_adaptor<A1<B>> A;
+ A a(A1<B>(5));
+ char buf[100];
+ typedef B S;
+ S* s = (S*)buf;
+ a.construct(s, 6);
+ assert(S::constructed);
+ s->~S();
+ }
+
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<C>> A;
+ A a(A1<int>(5), A2<C>(7));
+ char buf[100];
+ typedef C S;
+ S* s = (S*)buf;
+ a.construct(s, 8);
+ assert(S::constructed);
+ s->~S();
+ }
+
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<D>> A;
+ A a(A1<int>(5), A2<D>(3));
+ char buf[100];
+ typedef D S;
+ S* s = (S*)buf;
+ a.construct(s, 1, 2);
+ assert(S::constructed);
+ s->~S();
+ }
+
+ {
+ typedef std::scoped_allocator_adaptor<A3<E>, A2<E>> K;
+ typedef std::scoped_allocator_adaptor<K, A1<E>> A;
+ A a(K(), A1<E>(50));
+ char buf[100];
+ typedef E S;
+ S* s = (S*)buf;
+ A3<E>::constructed = false;
+ a.construct(s, 1, 2);
+ assert(S::constructed);
+ assert(A3<E>::constructed);
+ s->~S();
+ }
+
+ {
+ typedef std::scoped_allocator_adaptor<A3<F>, A2<F>> K;
+ typedef std::scoped_allocator_adaptor<K, A1<F>> A;
+ A a(K(), A1<F>(50));
+ char buf[100];
+ typedef F S;
+ S* s = (S*)buf;
+ A3<F>::constructed = false;
+ a.construct(s, 1, 2);
+ assert(!S::constructed);
+ assert(A3<F>::constructed);
+ s->~S();
+ }
+
+ // LWG 2586
+ // Test that is_constructible uses an lvalue ref so the correct constructor
+ // is picked.
+ {
+ G::allocator_type sa;
+ G* ptr = sa.allocate(1);
+ sa.construct(ptr);
+ assert(G::constructed);
+ sa.deallocate(ptr, 1);
+ }
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair.pass.cpp
index 39623f8043659..eac0452c04825 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair.pass.cpp
@@ -27,147 +27,135 @@
#include "test_macros.h"
-
-void test_no_inner_alloc()
-{
- using VoidAlloc = CountingAllocator<void>;
- AllocController P;
- {
- using T = UsesAllocatorV1<VoidAlloc, 0>;
- using U = UsesAllocatorV2<VoidAlloc, 0>;
- using Pair = std::pair<T, U>;
- using Alloc = CountingAllocator<Pair>;
- using SA = std::scoped_allocator_adaptor<Alloc>;
- static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr);
- Alloc CA(P);
- SA A(CA);
- A.construct(ptr);
- assert(checkConstruct<>(ptr->first, UA_AllocArg, CA));
- assert(checkConstruct<>(ptr->second, UA_AllocLast, CA));
+void test_no_inner_alloc() {
+ using VoidAlloc = CountingAllocator<void>;
+ AllocController P;
+ {
+ using T = UsesAllocatorV1<VoidAlloc, 0>;
+ using U = UsesAllocatorV2<VoidAlloc, 0>;
+ using Pair = std::pair<T, U>;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr);
+ Alloc CA(P);
+ SA A(CA);
+ A.construct(ptr);
+ assert(checkConstruct<>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<>(ptr->second, UA_AllocLast, CA));
#if TEST_STD_VER >= 20
- assert((P.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SA&>&&,
- std::tuple<const SA&>&&
- >(CA, ptr)));
+ assert((P.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SA&>&&,
+ std::tuple<const SA&>&& >(CA, ptr)));
#else
- assert((P.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SA&>&&,
- std::tuple<SA&>&&
- >(CA, ptr)));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&>&&,
+ std::tuple<SA&>&& >(CA, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
-
- }
- P.reset();
- {
- using T = UsesAllocatorV3<VoidAlloc, 0>;
- using U = NotUsesAllocator<VoidAlloc, 0>;
- using Pair = std::pair<T, U>;
- using Alloc = CountingAllocator<Pair>;
- using SA = std::scoped_allocator_adaptor<Alloc>;
- static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr);
- Alloc CA(P);
- SA A(CA);
- A.construct(ptr);
- assert(checkConstruct<>(ptr->first, UA_AllocArg, CA));
- assert(checkConstruct<>(ptr->second, UA_None));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+ P.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc, 0>;
+ using U = NotUsesAllocator<VoidAlloc, 0>;
+ using Pair = std::pair<T, U>;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr);
+ Alloc CA(P);
+ SA A(CA);
+ A.construct(ptr);
+ assert(checkConstruct<>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<>(ptr->second, UA_None));
#if TEST_STD_VER >= 20
- assert((P.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SA&>&&,
- std::tuple<>&&
- >(CA, ptr)));
+ assert(
+ (P.checkConstruct<std::piecewise_construct_t&&, std::tuple<std::allocator_arg_t, const SA&>&&, std::tuple<>&& >(
+ CA, ptr)));
#else
- assert((P.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SA&>&&,
- std::tuple<>&&
- >(CA, ptr)));
+ assert(
+ (P.checkConstruct<std::piecewise_construct_t const&, std::tuple<std::allocator_arg_t, SA&>&&, std::tuple<>&& >(
+ CA, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
- }
+ A.destroy(ptr);
+ std::free(ptr);
+ }
}
-void test_with_inner_alloc()
-{
- using VoidAlloc2 = CountingAllocator<void, 2>;
+void test_with_inner_alloc() {
+ using VoidAlloc2 = CountingAllocator<void, 2>;
- AllocController POuter;
- AllocController PInner;
- {
- using T = UsesAllocatorV1<VoidAlloc2, 0>;
- using U = UsesAllocatorV2<VoidAlloc2, 0>;
- using Pair = std::pair<T, U>;
- using Outer = CountingAllocator<Pair, 1>;
- using Inner = CountingAllocator<Pair, 2>;
- using SA = std::scoped_allocator_adaptor<Outer, Inner>;
- using SAInner = std::scoped_allocator_adaptor<Inner>;
- static_assert(!std::uses_allocator<T, Outer>::value, "");
- static_assert(std::uses_allocator<T, Inner>::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr);
- Outer O(POuter);
- Inner I(PInner);
- SA A(O, I);
- A.construct(ptr);
- assert(checkConstruct<>(ptr->first, UA_AllocArg, I));
- assert(checkConstruct<>(ptr->second, UA_AllocLast));
+ AllocController POuter;
+ AllocController PInner;
+ {
+ using T = UsesAllocatorV1<VoidAlloc2, 0>;
+ using U = UsesAllocatorV2<VoidAlloc2, 0>;
+ using Pair = std::pair<T, U>;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr);
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ A.construct(ptr);
+ assert(checkConstruct<>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<>(ptr->second, UA_AllocLast));
#if TEST_STD_VER >= 20
- assert((POuter.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SAInner&>&&,
- std::tuple<const SAInner&>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SAInner&>&&,
+ std::tuple<const SAInner&>&& >(O, ptr)));
#else
- assert((POuter.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SAInner&>&&,
- std::tuple<SAInner&>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&>&&,
+ std::tuple<SAInner&>&& >(O, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
- }
- PInner.reset();
- POuter.reset();
- {
- using T = UsesAllocatorV3<VoidAlloc2, 0>;
- using U = NotUsesAllocator<VoidAlloc2, 0>;
- using Pair = std::pair<T, U>;
- using Outer = CountingAllocator<Pair, 1>;
- using Inner = CountingAllocator<Pair, 2>;
- using SA = std::scoped_allocator_adaptor<Outer, Inner>;
- using SAInner = std::scoped_allocator_adaptor<Inner>;
- static_assert(!std::uses_allocator<T, Outer>::value, "");
- static_assert(std::uses_allocator<T, Inner>::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr);
- Outer O(POuter);
- Inner I(PInner);
- SA A(O, I);
- A.construct(ptr);
- assert(checkConstruct<>(ptr->first, UA_AllocArg, I));
- assert(checkConstruct<>(ptr->second, UA_None));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+ PInner.reset();
+ POuter.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc2, 0>;
+ using U = NotUsesAllocator<VoidAlloc2, 0>;
+ using Pair = std::pair<T, U>;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr);
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ A.construct(ptr);
+ assert(checkConstruct<>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<>(ptr->second, UA_None));
#if TEST_STD_VER >= 20
- assert((POuter.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SAInner&>&&,
- std::tuple<>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SAInner&>&&,
+ std::tuple<>&& >(O, ptr)));
#else
- assert((POuter.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SAInner&>&&,
- std::tuple<>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&>&&,
+ std::tuple<>&& >(O, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
- }
+ A.destroy(ptr);
+ std::free(ptr);
+ }
}
int main(int, char**) {
- test_no_inner_alloc();
- test_with_inner_alloc();
+ test_no_inner_alloc();
+ test_with_inner_alloc();
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp
index 57c3263322a0a..6fbbea68afbbc 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp
@@ -27,163 +27,151 @@
#include "test_macros.h"
-
-void test_no_inner_alloc()
-{
- using VoidAlloc = CountingAllocator<void>;
- AllocController P;
- {
- using T = UsesAllocatorV1<VoidAlloc, 1>;
- using U = UsesAllocatorV2<VoidAlloc, 1>;
- using Pair = std::pair<T, U>;
- using PairIn = std::pair<int&, int const&&>;
- int x = 42;
- const int y = 101;
- using Alloc = CountingAllocator<Pair>;
- using SA = std::scoped_allocator_adaptor<Alloc>;
- static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr != nullptr);
- Alloc CA(P);
- SA A(CA);
- const PairIn in(x, std::move(y));
- A.construct(ptr, in);
- assert(checkConstruct<int&>(ptr->first, UA_AllocArg, CA));
- assert(checkConstruct<int const&>(ptr->second, UA_AllocLast, CA));
+void test_no_inner_alloc() {
+ using VoidAlloc = CountingAllocator<void>;
+ AllocController P;
+ {
+ using T = UsesAllocatorV1<VoidAlloc, 1>;
+ using U = UsesAllocatorV2<VoidAlloc, 1>;
+ using Pair = std::pair<T, U>;
+ using PairIn = std::pair<int&, int const&&>;
+ int x = 42;
+ const int y = 101;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
+ Alloc CA(P);
+ SA A(CA);
+ const PairIn in(x, std::move(y));
+ A.construct(ptr, in);
+ assert(checkConstruct<int&>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<int const&>(ptr->second, UA_AllocLast, CA));
#if TEST_STD_VER >= 20
- assert((P.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SA&, int&>&&,
- std::tuple<int const&, const SA&>&&
- >(CA, ptr)));
+ assert((P.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SA&, int&>&&,
+ std::tuple<int const&, const SA&>&& >(CA, ptr)));
#else
- assert((P.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SA&, int&>&&,
- std::tuple<int const&, SA&>&&
- >(CA, ptr)));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&, int&>&&,
+ std::tuple<int const&, SA&>&& >(CA, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
-
- }
- P.reset();
- {
- using T = UsesAllocatorV3<VoidAlloc, 1>;
- using U = NotUsesAllocator<VoidAlloc, 1>;
- using Pair = std::pair<T, U>;
- using PairIn = std::pair<int, int const&>;
- int x = 42;
- const int y = 101;
- using Alloc = CountingAllocator<Pair>;
- using SA = std::scoped_allocator_adaptor<Alloc>;
- static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr != nullptr);
- Alloc CA(P);
- SA A(CA);
- const PairIn in(x, y);
- A.construct(ptr, in);
- assert(checkConstruct<int const&>(ptr->first, UA_AllocArg, CA));
- assert(checkConstruct<int const&>(ptr->second, UA_None));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+ P.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc, 1>;
+ using U = NotUsesAllocator<VoidAlloc, 1>;
+ using Pair = std::pair<T, U>;
+ using PairIn = std::pair<int, int const&>;
+ int x = 42;
+ const int y = 101;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
+ Alloc CA(P);
+ SA A(CA);
+ const PairIn in(x, y);
+ A.construct(ptr, in);
+ assert(checkConstruct<int const&>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<int const&>(ptr->second, UA_None));
#if TEST_STD_VER >= 20
- assert((P.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SA&, int const&>&&,
- std::tuple<int const&>&&
- >(CA, ptr)));
+ assert((P.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SA&, int const&>&&,
+ std::tuple<int const&>&& >(CA, ptr)));
#else
- assert((P.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SA&, int const&>&&,
- std::tuple<int const&>&&
- >(CA, ptr)));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&, int const&>&&,
+ std::tuple<int const&>&& >(CA, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
- }
+ A.destroy(ptr);
+ std::free(ptr);
+ }
}
-void test_with_inner_alloc()
-{
- using VoidAlloc2 = CountingAllocator<void, 2>;
+void test_with_inner_alloc() {
+ using VoidAlloc2 = CountingAllocator<void, 2>;
- AllocController POuter;
- AllocController PInner;
- {
- using T = UsesAllocatorV1<VoidAlloc2, 1>;
- using U = UsesAllocatorV2<VoidAlloc2, 1>;
- using Pair = std::pair<T, U>;
- using PairIn = std::pair<int&, int const&&>;
- int x = 42;
- int y = 101;
- using Outer = CountingAllocator<Pair, 1>;
- using Inner = CountingAllocator<Pair, 2>;
- using SA = std::scoped_allocator_adaptor<Outer, Inner>;
- using SAInner = std::scoped_allocator_adaptor<Inner>;
- static_assert(!std::uses_allocator<T, Outer>::value, "");
- static_assert(std::uses_allocator<T, Inner>::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr != nullptr);
- Outer O(POuter);
- Inner I(PInner);
- SA A(O, I);
- const PairIn in(x, std::move(y));
- A.construct(ptr, in);
- assert(checkConstruct<int&>(ptr->first, UA_AllocArg, I));
- assert(checkConstruct<int const&>(ptr->second, UA_AllocLast));
+ AllocController POuter;
+ AllocController PInner;
+ {
+ using T = UsesAllocatorV1<VoidAlloc2, 1>;
+ using U = UsesAllocatorV2<VoidAlloc2, 1>;
+ using Pair = std::pair<T, U>;
+ using PairIn = std::pair<int&, int const&&>;
+ int x = 42;
+ int y = 101;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ const PairIn in(x, std::move(y));
+ A.construct(ptr, in);
+ assert(checkConstruct<int&>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<int const&>(ptr->second, UA_AllocLast));
#if TEST_STD_VER >= 20
- assert((POuter.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SAInner&, int&>&&,
- std::tuple<int const&, const SAInner&>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SAInner&, int&>&&,
+ std::tuple<int const&, const SAInner&>&& >(O, ptr)));
#else
- assert((POuter.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SAInner&, int&>&&,
- std::tuple<int const&, SAInner&>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&, int&>&&,
+ std::tuple<int const&, SAInner&>&& >(O, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
- }
- PInner.reset();
- POuter.reset();
- {
- using T = UsesAllocatorV3<VoidAlloc2, 1>;
- using U = NotUsesAllocator<VoidAlloc2, 1>;
- using Pair = std::pair<T, U>;
- using PairIn = std::pair<int, int const &>;
- int x = 42;
- int y = 101;
- using Outer = CountingAllocator<Pair, 1>;
- using Inner = CountingAllocator<Pair, 2>;
- using SA = std::scoped_allocator_adaptor<Outer, Inner>;
- using SAInner = std::scoped_allocator_adaptor<Inner>;
- static_assert(!std::uses_allocator<T, Outer>::value, "");
- static_assert(std::uses_allocator<T, Inner>::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr != nullptr);
- Outer O(POuter);
- Inner I(PInner);
- SA A(O, I);
- const PairIn in(x, y);
- A.construct(ptr, in);
- assert(checkConstruct<int const&>(ptr->first, UA_AllocArg, I));
- assert(checkConstruct<int const&>(ptr->second, UA_None));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+ PInner.reset();
+ POuter.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc2, 1>;
+ using U = NotUsesAllocator<VoidAlloc2, 1>;
+ using Pair = std::pair<T, U>;
+ using PairIn = std::pair<int, int const&>;
+ int x = 42;
+ int y = 101;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ const PairIn in(x, y);
+ A.construct(ptr, in);
+ assert(checkConstruct<int const&>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<int const&>(ptr->second, UA_None));
#if TEST_STD_VER >= 20
- assert((POuter.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SAInner&, int const&>&&,
- std::tuple<int const&>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SAInner&, int const&>&&,
+ std::tuple<int const&>&& >(O, ptr)));
#else
- assert((POuter.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SAInner&, int const&>&&,
- std::tuple<int const&>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&, int const&>&&,
+ std::tuple<int const&>&& >(O, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
- }
+ A.destroy(ptr);
+ std::free(ptr);
+ }
}
int main(int, char**) {
- test_no_inner_alloc();
- test_with_inner_alloc();
+ test_no_inner_alloc();
+ test_with_inner_alloc();
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp
index b07f0362c7a64..79cb05ebee049 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp
@@ -28,163 +28,144 @@
#include "test_macros.h"
-
-void test_no_inner_alloc()
-{
- using VoidAlloc = CountingAllocator<void>;
- AllocController P;
- {
- using T = UsesAllocatorV1<VoidAlloc, 1>;
- using U = UsesAllocatorV2<VoidAlloc, 1>;
- using Pair = std::pair<T, U>;
- int x = 42;
- const int y = 101;
- using Alloc = CountingAllocator<Pair>;
- using SA = std::scoped_allocator_adaptor<Alloc>;
- static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr != nullptr);
- Alloc CA(P);
- SA A(CA);
- A.construct(ptr, std::piecewise_construct,
- std::forward_as_tuple(x),
- std::forward_as_tuple(std::move(y)));
- assert(checkConstruct<int&>(ptr->first, UA_AllocArg, CA));
- assert(checkConstruct<int const&&>(ptr->second, UA_AllocLast, CA));
+void test_no_inner_alloc() {
+ using VoidAlloc = CountingAllocator<void>;
+ AllocController P;
+ {
+ using T = UsesAllocatorV1<VoidAlloc, 1>;
+ using U = UsesAllocatorV2<VoidAlloc, 1>;
+ using Pair = std::pair<T, U>;
+ int x = 42;
+ const int y = 101;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
+ Alloc CA(P);
+ SA A(CA);
+ A.construct(ptr, std::piecewise_construct, std::forward_as_tuple(x), std::forward_as_tuple(std::move(y)));
+ assert(checkConstruct<int&>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<int const&&>(ptr->second, UA_AllocLast, CA));
#if TEST_STD_VER >= 20
- assert((P.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SA&, int&>&&,
- std::tuple<int const&&, const SA&>&&
- >(CA, ptr)));
+ assert((P.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SA&, int&>&&,
+ std::tuple<int const&&, const SA&>&& >(CA, ptr)));
#else
- assert((P.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SA&, int&>&&,
- std::tuple<int const&&, SA&>&&
- >(CA, ptr)));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&, int&>&&,
+ std::tuple<int const&&, SA&>&& >(CA, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
-
- }
- P.reset();
- {
- using T = UsesAllocatorV3<VoidAlloc, 1>;
- using U = NotUsesAllocator<VoidAlloc, 1>;
- using Pair = std::pair<T, U>;
- int x = 42;
- const int y = 101;
- using Alloc = CountingAllocator<Pair>;
- using SA = std::scoped_allocator_adaptor<Alloc>;
- static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr != nullptr);
- Alloc CA(P);
- SA A(CA);
- A.construct(ptr, std::piecewise_construct,
- std::forward_as_tuple(std::move(x)),
- std::forward_as_tuple(y));
- assert(checkConstruct<int&&>(ptr->first, UA_AllocArg, CA));
- assert(checkConstruct<int const&>(ptr->second, UA_None));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+ P.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc, 1>;
+ using U = NotUsesAllocator<VoidAlloc, 1>;
+ using Pair = std::pair<T, U>;
+ int x = 42;
+ const int y = 101;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
+ Alloc CA(P);
+ SA A(CA);
+ A.construct(ptr, std::piecewise_construct, std::forward_as_tuple(std::move(x)), std::forward_as_tuple(y));
+ assert(checkConstruct<int&&>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<int const&>(ptr->second, UA_None));
#if TEST_STD_VER >= 20
- assert((P.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SA&, int&&>&&,
- std::tuple<int const&>&&
- >(CA, ptr)));
+ assert((P.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SA&, int&&>&&,
+ std::tuple<int const&>&& >(CA, ptr)));
#else
- assert((P.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SA&, int&&>&&,
- std::tuple<int const&>&&
- >(CA, ptr)));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&, int&&>&&,
+ std::tuple<int const&>&& >(CA, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
- }
+ A.destroy(ptr);
+ std::free(ptr);
+ }
}
-void test_with_inner_alloc()
-{
- using VoidAlloc2 = CountingAllocator<void, 2>;
+void test_with_inner_alloc() {
+ using VoidAlloc2 = CountingAllocator<void, 2>;
- AllocController POuter;
- AllocController PInner;
- {
- using T = UsesAllocatorV1<VoidAlloc2, 1>;
- using U = UsesAllocatorV2<VoidAlloc2, 1>;
- using Pair = std::pair<T, U>;
- int x = 42;
- int y = 101;
- using Outer = CountingAllocator<Pair, 1>;
- using Inner = CountingAllocator<Pair, 2>;
- using SA = std::scoped_allocator_adaptor<Outer, Inner>;
- using SAInner = std::scoped_allocator_adaptor<Inner>;
- static_assert(!std::uses_allocator<T, Outer>::value, "");
- static_assert(std::uses_allocator<T, Inner>::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr != nullptr);
- Outer O(POuter);
- Inner I(PInner);
- SA A(O, I);
- A.construct(ptr, std::piecewise_construct,
- std::forward_as_tuple(x),
- std::forward_as_tuple(std::move(y)));
- assert(checkConstruct<int&>(ptr->first, UA_AllocArg, I));
- assert(checkConstruct<int &&>(ptr->second, UA_AllocLast));
+ AllocController POuter;
+ AllocController PInner;
+ {
+ using T = UsesAllocatorV1<VoidAlloc2, 1>;
+ using U = UsesAllocatorV2<VoidAlloc2, 1>;
+ using Pair = std::pair<T, U>;
+ int x = 42;
+ int y = 101;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ A.construct(ptr, std::piecewise_construct, std::forward_as_tuple(x), std::forward_as_tuple(std::move(y)));
+ assert(checkConstruct<int&>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<int&&>(ptr->second, UA_AllocLast));
#if TEST_STD_VER >= 20
- assert((POuter.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SAInner&, int&>&&,
- std::tuple<int &&, const SAInner&>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SAInner&, int&>&&,
+ std::tuple<int&&, const SAInner&>&& >(O, ptr)));
#else
- assert((POuter.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SAInner&, int&>&&,
- std::tuple<int &&, SAInner&>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&, int&>&&,
+ std::tuple<int&&, SAInner&>&& >(O, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
- }
- PInner.reset();
- POuter.reset();
- {
- using T = UsesAllocatorV3<VoidAlloc2, 1>;
- using U = NotUsesAllocator<VoidAlloc2, 1>;
- using Pair = std::pair<T, U>;
- int x = 42;
- const int y = 101;
- using Outer = CountingAllocator<Pair, 1>;
- using Inner = CountingAllocator<Pair, 2>;
- using SA = std::scoped_allocator_adaptor<Outer, Inner>;
- using SAInner = std::scoped_allocator_adaptor<Inner>;
- static_assert(!std::uses_allocator<T, Outer>::value, "");
- static_assert(std::uses_allocator<T, Inner>::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr != nullptr);
- Outer O(POuter);
- Inner I(PInner);
- SA A(O, I);
- A.construct(ptr, std::piecewise_construct,
- std::forward_as_tuple(std::move(x)),
- std::forward_as_tuple(std::move(y)));
- assert(checkConstruct<int&&>(ptr->first, UA_AllocArg, I));
- assert(checkConstruct<int const&&>(ptr->second, UA_None));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+ PInner.reset();
+ POuter.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc2, 1>;
+ using U = NotUsesAllocator<VoidAlloc2, 1>;
+ using Pair = std::pair<T, U>;
+ int x = 42;
+ const int y = 101;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ A.construct(
+ ptr, std::piecewise_construct, std::forward_as_tuple(std::move(x)), std::forward_as_tuple(std::move(y)));
+ assert(checkConstruct<int&&>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<int const&&>(ptr->second, UA_None));
#if TEST_STD_VER >= 20
- assert((POuter.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SAInner&, int&&>&&,
- std::tuple<int const&&>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SAInner&, int&&>&&,
+ std::tuple<int const&&>&& >(O, ptr)));
#else
- assert((POuter.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SAInner&, int&&>&&,
- std::tuple<int const&&>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&, int&&>&&,
+ std::tuple<int const&&>&& >(O, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
- }
+ A.destroy(ptr);
+ std::free(ptr);
+ }
}
int main(int, char**) {
- test_no_inner_alloc();
- test_with_inner_alloc();
+ test_no_inner_alloc();
+ test_with_inner_alloc();
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp
index 4d01e3e1cf792..f6bd83550d271 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp
@@ -27,163 +27,151 @@
#include "test_macros.h"
-
-void test_no_inner_alloc()
-{
- using VoidAlloc = CountingAllocator<void>;
- AllocController P;
- {
- using T = UsesAllocatorV1<VoidAlloc, 1>;
- using U = UsesAllocatorV2<VoidAlloc, 1>;
- using Pair = std::pair<T, U>;
- using PairIn = std::pair<int&, int const&&>;
- int x = 42;
- const int y = 101;
- using Alloc = CountingAllocator<Pair>;
- using SA = std::scoped_allocator_adaptor<Alloc>;
- static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr != nullptr);
- Alloc CA(P);
- SA A(CA);
- PairIn in(x, std::move(y));
- A.construct(ptr, std::move(in));
- assert(checkConstruct<int&>(ptr->first, UA_AllocArg, CA));
- assert(checkConstruct<int const&&>(ptr->second, UA_AllocLast, CA));
+void test_no_inner_alloc() {
+ using VoidAlloc = CountingAllocator<void>;
+ AllocController P;
+ {
+ using T = UsesAllocatorV1<VoidAlloc, 1>;
+ using U = UsesAllocatorV2<VoidAlloc, 1>;
+ using Pair = std::pair<T, U>;
+ using PairIn = std::pair<int&, int const&&>;
+ int x = 42;
+ const int y = 101;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
+ Alloc CA(P);
+ SA A(CA);
+ PairIn in(x, std::move(y));
+ A.construct(ptr, std::move(in));
+ assert(checkConstruct<int&>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<int const&&>(ptr->second, UA_AllocLast, CA));
#if TEST_STD_VER >= 20
- assert((P.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SA&, int&>&&,
- std::tuple<int const&&, const SA&>&&
- >(CA, ptr)));
+ assert((P.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SA&, int&>&&,
+ std::tuple<int const&&, const SA&>&& >(CA, ptr)));
#else
- assert((P.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SA&, int&>&&,
- std::tuple<int const&&, SA&>&&
- >(CA, ptr)));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&, int&>&&,
+ std::tuple<int const&&, SA&>&& >(CA, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
-
- }
- P.reset();
- {
- using T = UsesAllocatorV3<VoidAlloc, 1>;
- using U = NotUsesAllocator<VoidAlloc, 1>;
- using Pair = std::pair<T, U>;
- using PairIn = std::pair<int, int const&>;
- int x = 42;
- const int y = 101;
- using Alloc = CountingAllocator<Pair>;
- using SA = std::scoped_allocator_adaptor<Alloc>;
- static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr != nullptr);
- Alloc CA(P);
- SA A(CA);
- PairIn in(x, y);
- A.construct(ptr, std::move(in));
- assert(checkConstruct<int&&>(ptr->first, UA_AllocArg, CA));
- assert(checkConstruct<int const&>(ptr->second, UA_None));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+ P.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc, 1>;
+ using U = NotUsesAllocator<VoidAlloc, 1>;
+ using Pair = std::pair<T, U>;
+ using PairIn = std::pair<int, int const&>;
+ int x = 42;
+ const int y = 101;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
+ Alloc CA(P);
+ SA A(CA);
+ PairIn in(x, y);
+ A.construct(ptr, std::move(in));
+ assert(checkConstruct<int&&>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<int const&>(ptr->second, UA_None));
#if TEST_STD_VER >= 20
- assert((P.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SA&, int&&>&&,
- std::tuple<int const&>&&
- >(CA, ptr)));
+ assert((P.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SA&, int&&>&&,
+ std::tuple<int const&>&& >(CA, ptr)));
#else
- assert((P.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SA&, int&&>&&,
- std::tuple<int const&>&&
- >(CA, ptr)));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&, int&&>&&,
+ std::tuple<int const&>&& >(CA, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
- }
+ A.destroy(ptr);
+ std::free(ptr);
+ }
}
-void test_with_inner_alloc()
-{
- using VoidAlloc2 = CountingAllocator<void, 2>;
+void test_with_inner_alloc() {
+ using VoidAlloc2 = CountingAllocator<void, 2>;
- AllocController POuter;
- AllocController PInner;
- {
- using T = UsesAllocatorV1<VoidAlloc2, 1>;
- using U = UsesAllocatorV2<VoidAlloc2, 1>;
- using Pair = std::pair<T, U>;
- using PairIn = std::pair<int&, int const&&>;
- int x = 42;
- int y = 101;
- using Outer = CountingAllocator<Pair, 1>;
- using Inner = CountingAllocator<Pair, 2>;
- using SA = std::scoped_allocator_adaptor<Outer, Inner>;
- using SAInner = std::scoped_allocator_adaptor<Inner>;
- static_assert(!std::uses_allocator<T, Outer>::value, "");
- static_assert(std::uses_allocator<T, Inner>::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr != nullptr);
- Outer O(POuter);
- Inner I(PInner);
- SA A(O, I);
- PairIn in(x, std::move(y));
- A.construct(ptr, std::move(in));
- assert(checkConstruct<int&>(ptr->first, UA_AllocArg, I));
- assert(checkConstruct<int const&&>(ptr->second, UA_AllocLast));
+ AllocController POuter;
+ AllocController PInner;
+ {
+ using T = UsesAllocatorV1<VoidAlloc2, 1>;
+ using U = UsesAllocatorV2<VoidAlloc2, 1>;
+ using Pair = std::pair<T, U>;
+ using PairIn = std::pair<int&, int const&&>;
+ int x = 42;
+ int y = 101;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ PairIn in(x, std::move(y));
+ A.construct(ptr, std::move(in));
+ assert(checkConstruct<int&>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<int const&&>(ptr->second, UA_AllocLast));
#if TEST_STD_VER >= 20
- assert((POuter.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SAInner&, int&>&&,
- std::tuple<int const&&, const SAInner&>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SAInner&, int&>&&,
+ std::tuple<int const&&, const SAInner&>&& >(O, ptr)));
#else
- assert((POuter.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SAInner&, int&>&&,
- std::tuple<int const&&, SAInner&>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&, int&>&&,
+ std::tuple<int const&&, SAInner&>&& >(O, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
- }
- PInner.reset();
- POuter.reset();
- {
- using T = UsesAllocatorV3<VoidAlloc2, 1>;
- using U = NotUsesAllocator<VoidAlloc2, 1>;
- using Pair = std::pair<T, U>;
- using PairIn = std::pair<int, int const &>;
- int x = 42;
- int y = 101;
- using Outer = CountingAllocator<Pair, 1>;
- using Inner = CountingAllocator<Pair, 2>;
- using SA = std::scoped_allocator_adaptor<Outer, Inner>;
- using SAInner = std::scoped_allocator_adaptor<Inner>;
- static_assert(!std::uses_allocator<T, Outer>::value, "");
- static_assert(std::uses_allocator<T, Inner>::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr != nullptr);
- Outer O(POuter);
- Inner I(PInner);
- SA A(O, I);
- PairIn in(x, y);
- A.construct(ptr, std::move(in));
- assert(checkConstruct<int&&>(ptr->first, UA_AllocArg, I));
- assert(checkConstruct<int const&>(ptr->second, UA_None));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+ PInner.reset();
+ POuter.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc2, 1>;
+ using U = NotUsesAllocator<VoidAlloc2, 1>;
+ using Pair = std::pair<T, U>;
+ using PairIn = std::pair<int, int const&>;
+ int x = 42;
+ int y = 101;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ PairIn in(x, y);
+ A.construct(ptr, std::move(in));
+ assert(checkConstruct<int&&>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<int const&>(ptr->second, UA_None));
#if TEST_STD_VER >= 20
- assert((POuter.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SAInner&, int&&>&&,
- std::tuple<int const&>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SAInner&, int&&>&&,
+ std::tuple<int const&>&& >(O, ptr)));
#else
- assert((POuter.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SAInner&, int&&>&&,
- std::tuple<int const&>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&, int&&>&&,
+ std::tuple<int const&>&& >(O, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
- }
+ A.destroy(ptr);
+ std::free(ptr);
+ }
}
int main(int, char**) {
- test_no_inner_alloc();
- test_with_inner_alloc();
+ test_no_inner_alloc();
+ test_with_inner_alloc();
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp
index 10f2f4843230b..66c3259072e64 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp
@@ -27,155 +27,143 @@
#include "test_macros.h"
-
-void test_no_inner_alloc()
-{
- using VoidAlloc = CountingAllocator<void>;
- AllocController P;
- {
- using T = UsesAllocatorV1<VoidAlloc, 1>;
- using U = UsesAllocatorV2<VoidAlloc, 1>;
- using Pair = std::pair<T, U>;
- int x = 42;
- const int y = 101;
- using Alloc = CountingAllocator<Pair>;
- using SA = std::scoped_allocator_adaptor<Alloc>;
- static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr != nullptr);
- Alloc CA(P);
- SA A(CA);
- A.construct(ptr, x, std::move(y));
- assert(checkConstruct<int&>(ptr->first, UA_AllocArg, CA));
- assert(checkConstruct<int const&&>(ptr->second, UA_AllocLast, CA));
+void test_no_inner_alloc() {
+ using VoidAlloc = CountingAllocator<void>;
+ AllocController P;
+ {
+ using T = UsesAllocatorV1<VoidAlloc, 1>;
+ using U = UsesAllocatorV2<VoidAlloc, 1>;
+ using Pair = std::pair<T, U>;
+ int x = 42;
+ const int y = 101;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
+ Alloc CA(P);
+ SA A(CA);
+ A.construct(ptr, x, std::move(y));
+ assert(checkConstruct<int&>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<int const&&>(ptr->second, UA_AllocLast, CA));
#if TEST_STD_VER >= 20
- assert((P.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SA&, int&>&&,
- std::tuple<int const&&, const SA&>&&
- >(CA, ptr)));
+ assert((P.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SA&, int&>&&,
+ std::tuple<int const&&, const SA&>&& >(CA, ptr)));
#else
- assert((P.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SA&, int&>&&,
- std::tuple<int const&&, SA&>&&
- >(CA, ptr)));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&, int&>&&,
+ std::tuple<int const&&, SA&>&& >(CA, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
-
- }
- P.reset();
- {
- using T = UsesAllocatorV3<VoidAlloc, 1>;
- using U = NotUsesAllocator<VoidAlloc, 1>;
- using Pair = std::pair<T, U>;
- int x = 42;
- const int y = 101;
- using Alloc = CountingAllocator<Pair>;
- using SA = std::scoped_allocator_adaptor<Alloc>;
- static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr != nullptr);
- Alloc CA(P);
- SA A(CA);
- A.construct(ptr, std::move(x), y);
- assert(checkConstruct<int&&>(ptr->first, UA_AllocArg, CA));
- assert(checkConstruct<int const&>(ptr->second, UA_None));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+ P.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc, 1>;
+ using U = NotUsesAllocator<VoidAlloc, 1>;
+ using Pair = std::pair<T, U>;
+ int x = 42;
+ const int y = 101;
+ using Alloc = CountingAllocator<Pair>;
+ using SA = std::scoped_allocator_adaptor<Alloc>;
+ static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
+ Alloc CA(P);
+ SA A(CA);
+ A.construct(ptr, std::move(x), y);
+ assert(checkConstruct<int&&>(ptr->first, UA_AllocArg, CA));
+ assert(checkConstruct<int const&>(ptr->second, UA_None));
#if TEST_STD_VER >= 20
- assert((P.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SA&, int&&>&&,
- std::tuple<int const&>&&
- >(CA, ptr)));
+ assert((P.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SA&, int&&>&&,
+ std::tuple<int const&>&& >(CA, ptr)));
#else
- assert((P.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SA&, int&&>&&,
- std::tuple<int const&>&&
- >(CA, ptr)));
+ assert((P.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SA&, int&&>&&,
+ std::tuple<int const&>&& >(CA, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
- }
+ A.destroy(ptr);
+ std::free(ptr);
+ }
}
-void test_with_inner_alloc()
-{
- using VoidAlloc2 = CountingAllocator<void, 2>;
+void test_with_inner_alloc() {
+ using VoidAlloc2 = CountingAllocator<void, 2>;
- AllocController POuter;
- AllocController PInner;
- {
- using T = UsesAllocatorV1<VoidAlloc2, 1>;
- using U = UsesAllocatorV2<VoidAlloc2, 1>;
- using Pair = std::pair<T, U>;
- int x = 42;
- int y = 101;
- using Outer = CountingAllocator<Pair, 1>;
- using Inner = CountingAllocator<Pair, 2>;
- using SA = std::scoped_allocator_adaptor<Outer, Inner>;
- using SAInner = std::scoped_allocator_adaptor<Inner>;
- static_assert(!std::uses_allocator<T, Outer>::value, "");
- static_assert(std::uses_allocator<T, Inner>::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr != nullptr);
- Outer O(POuter);
- Inner I(PInner);
- SA A(O, I);
- A.construct(ptr, x, std::move(y));
- assert(checkConstruct<int&>(ptr->first, UA_AllocArg, I));
- assert(checkConstruct<int &&>(ptr->second, UA_AllocLast));
+ AllocController POuter;
+ AllocController PInner;
+ {
+ using T = UsesAllocatorV1<VoidAlloc2, 1>;
+ using U = UsesAllocatorV2<VoidAlloc2, 1>;
+ using Pair = std::pair<T, U>;
+ int x = 42;
+ int y = 101;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ A.construct(ptr, x, std::move(y));
+ assert(checkConstruct<int&>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<int&&>(ptr->second, UA_AllocLast));
#if TEST_STD_VER >= 20
- assert((POuter.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SAInner&, int&>&&,
- std::tuple<int &&, const SAInner&>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SAInner&, int&>&&,
+ std::tuple<int&&, const SAInner&>&& >(O, ptr)));
#else
- assert((POuter.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SAInner&, int&>&&,
- std::tuple<int &&, SAInner&>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&, int&>&&,
+ std::tuple<int&&, SAInner&>&& >(O, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
- }
- PInner.reset();
- POuter.reset();
- {
- using T = UsesAllocatorV3<VoidAlloc2, 1>;
- using U = NotUsesAllocator<VoidAlloc2, 1>;
- using Pair = std::pair<T, U>;
- int x = 42;
- const int y = 101;
- using Outer = CountingAllocator<Pair, 1>;
- using Inner = CountingAllocator<Pair, 2>;
- using SA = std::scoped_allocator_adaptor<Outer, Inner>;
- using SAInner = std::scoped_allocator_adaptor<Inner>;
- static_assert(!std::uses_allocator<T, Outer>::value, "");
- static_assert(std::uses_allocator<T, Inner>::value, "");
- Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
- assert(ptr != nullptr);
- Outer O(POuter);
- Inner I(PInner);
- SA A(O, I);
- A.construct(ptr, std::move(x), std::move(y));
- assert(checkConstruct<int&&>(ptr->first, UA_AllocArg, I));
- assert(checkConstruct<int const&&>(ptr->second, UA_None));
+ A.destroy(ptr);
+ std::free(ptr);
+ }
+ PInner.reset();
+ POuter.reset();
+ {
+ using T = UsesAllocatorV3<VoidAlloc2, 1>;
+ using U = NotUsesAllocator<VoidAlloc2, 1>;
+ using Pair = std::pair<T, U>;
+ int x = 42;
+ const int y = 101;
+ using Outer = CountingAllocator<Pair, 1>;
+ using Inner = CountingAllocator<Pair, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ using SAInner = std::scoped_allocator_adaptor<Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ Pair* ptr = (Pair*)std::malloc(sizeof(Pair));
+ assert(ptr != nullptr);
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ A.construct(ptr, std::move(x), std::move(y));
+ assert(checkConstruct<int&&>(ptr->first, UA_AllocArg, I));
+ assert(checkConstruct<int const&&>(ptr->second, UA_None));
#if TEST_STD_VER >= 20
- assert((POuter.checkConstruct<std::piecewise_construct_t&&,
- std::tuple<std::allocator_arg_t, const SAInner&, int&&>&&,
- std::tuple<int const&&>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t&&,
+ std::tuple<std::allocator_arg_t, const SAInner&, int&&>&&,
+ std::tuple<int const&&>&& >(O, ptr)));
#else
- assert((POuter.checkConstruct<std::piecewise_construct_t const&,
- std::tuple<std::allocator_arg_t, SAInner&, int&&>&&,
- std::tuple<int const&&>&&
- >(O, ptr)));
+ assert((POuter.checkConstruct<std::piecewise_construct_t const&,
+ std::tuple<std::allocator_arg_t, SAInner&, int&&>&&,
+ std::tuple<int const&&>&& >(O, ptr)));
#endif
- A.destroy(ptr);
- std::free(ptr);
- }
+ A.destroy(ptr);
+ std::free(ptr);
+ }
}
int main(int, char**) {
- test_no_inner_alloc();
- test_with_inner_alloc();
+ test_no_inner_alloc();
+ test_with_inner_alloc();
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp
index ef35897ef636a..0ae3e6715606f 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp
@@ -32,70 +32,69 @@
// OUTERMOST_ALLOC_TRAITS(*this)::construct(
// OUTERMOST (*this), p, std::forward<Args>(args)...).
void test_bullet_one() {
- using VoidAlloc2 = CountingAllocator<void, 2>;
+ using VoidAlloc2 = CountingAllocator<void, 2>;
- AllocController POuter;
- AllocController PInner;
- {
- using T = NotUsesAllocator<VoidAlloc2, 3>;
- using Outer = CountingAllocator<T, 1>;
- using Inner = CountingAllocator<T, 2>;
- using SA = std::scoped_allocator_adaptor<Outer, Inner>;
- static_assert(!std::uses_allocator<T, Outer>::value, "");
- static_assert(!std::uses_allocator<T, Inner>::value, "");
- T* ptr = (T*)::operator new(sizeof(T));
- Outer O(POuter);
- Inner I(PInner);
- SA A(O, I);
- int x = 42;
- int const& cx = x;
- A.construct(ptr, x, cx, std::move(x));
- assert((checkConstruct<int&, int const&, int&&>(*ptr, UA_None)));
- assert((POuter.checkConstruct<int&, int const&, int&&>(O, ptr)));
- A.destroy(ptr);
- ::operator delete((void*)ptr);
- }
- PInner.reset();
- POuter.reset();
+ AllocController POuter;
+ AllocController PInner;
+ {
+ using T = NotUsesAllocator<VoidAlloc2, 3>;
+ using Outer = CountingAllocator<T, 1>;
+ using Inner = CountingAllocator<T, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(!std::uses_allocator<T, Inner>::value, "");
+ T* ptr = (T*)::operator new(sizeof(T));
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ int x = 42;
+ int const& cx = x;
+ A.construct(ptr, x, cx, std::move(x));
+ assert((checkConstruct<int&, int const&, int&&>(*ptr, UA_None)));
+ assert((POuter.checkConstruct<int&, int const&, int&&>(O, ptr)));
+ A.destroy(ptr);
+ ::operator delete((void*)ptr);
+ }
+ PInner.reset();
+ POuter.reset();
}
-
// Otherwise, if uses_allocator_v<T, inner_allocator_type> is true and
// is_constructible_v<T, allocator_arg_t, inner_allocator_type&, Args...> is
// true, calls OUTERMOST_ALLOC_TRAITS(*this)::construct(OUTERMOST (*this), p,
// allocator_arg, inner_allocator(), std::forward<Args>(args)...).
void test_bullet_two() {
- using VoidAlloc2 = CountingAllocator<void, 2>;
+ using VoidAlloc2 = CountingAllocator<void, 2>;
- AllocController POuter;
- AllocController PInner;
- {
- using T = UsesAllocatorV1<VoidAlloc2, 3>;
- using Outer = CountingAllocator<T, 1>;
- using Inner = CountingAllocator<T, 2>;
- using SA = std::scoped_allocator_adaptor<Outer, Inner>;
- static_assert(!std::uses_allocator<T, Outer>::value, "");
- static_assert(std::uses_allocator<T, Inner>::value, "");
- T* ptr = (T*)::operator new(sizeof(T));
- Outer O(POuter);
- Inner I(PInner);
- SA A(O, I);
- int x = 42;
- int const& cx = x;
- A.construct(ptr, x, cx, std::move(x));
- assert((checkConstruct<int&, int const&, int&&>(*ptr, UA_AllocArg, I)));
+ AllocController POuter;
+ AllocController PInner;
+ {
+ using T = UsesAllocatorV1<VoidAlloc2, 3>;
+ using Outer = CountingAllocator<T, 1>;
+ using Inner = CountingAllocator<T, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ T* ptr = (T*)::operator new(sizeof(T));
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ int x = 42;
+ int const& cx = x;
+ A.construct(ptr, x, cx, std::move(x));
+ assert((checkConstruct<int&, int const&, int&&>(*ptr, UA_AllocArg, I)));
#if TEST_STD_VER >= 20
- assert((POuter.checkConstruct<std::allocator_arg_t&&,
- const SA::inner_allocator_type&, int&, int const&, int&&>(O, ptr)));
+ assert((POuter.checkConstruct<std::allocator_arg_t&&, const SA::inner_allocator_type&, int&, int const&, int&&>(
+ O, ptr)));
#else
- assert((POuter.checkConstruct<std::allocator_arg_t const&,
- SA::inner_allocator_type&, int&, int const&, int&&>(O, ptr)));
+ assert((POuter.checkConstruct<std::allocator_arg_t const&, SA::inner_allocator_type&, int&, int const&, int&&>(
+ O, ptr)));
#endif
- A.destroy(ptr);
- ::operator delete((void*)ptr);
- }
- PInner.reset();
- POuter.reset();
+ A.destroy(ptr);
+ ::operator delete((void*)ptr);
+ }
+ PInner.reset();
+ POuter.reset();
}
// Otherwise, if uses_allocator_v<T, inner_allocator_type> is true and
@@ -103,45 +102,41 @@ void test_bullet_two() {
// OUTERMOST_ALLOC_TRAITS(*this)::construct(OUTERMOST (*this), p,
// std::forward<Args>(args)..., inner_allocator()).
void test_bullet_three() {
- using VoidAlloc2 = CountingAllocator<void, 2>;
+ using VoidAlloc2 = CountingAllocator<void, 2>;
- AllocController POuter;
- AllocController PInner;
- {
- using T = UsesAllocatorV2<VoidAlloc2, 3>;
- using Outer = CountingAllocator<T, 1>;
- using Inner = CountingAllocator<T, 2>;
- using SA = std::scoped_allocator_adaptor<Outer, Inner>;
- static_assert(!std::uses_allocator<T, Outer>::value, "");
- static_assert(std::uses_allocator<T, Inner>::value, "");
- T* ptr = (T*)::operator new(sizeof(T));
- Outer O(POuter);
- Inner I(PInner);
- SA A(O, I);
- int x = 42;
- int const& cx = x;
- A.construct(ptr, x, cx, std::move(x));
- assert((checkConstruct<int&, int const&, int&&>(*ptr, UA_AllocLast, I)));
+ AllocController POuter;
+ AllocController PInner;
+ {
+ using T = UsesAllocatorV2<VoidAlloc2, 3>;
+ using Outer = CountingAllocator<T, 1>;
+ using Inner = CountingAllocator<T, 2>;
+ using SA = std::scoped_allocator_adaptor<Outer, Inner>;
+ static_assert(!std::uses_allocator<T, Outer>::value, "");
+ static_assert(std::uses_allocator<T, Inner>::value, "");
+ T* ptr = (T*)::operator new(sizeof(T));
+ Outer O(POuter);
+ Inner I(PInner);
+ SA A(O, I);
+ int x = 42;
+ int const& cx = x;
+ A.construct(ptr, x, cx, std::move(x));
+ assert((checkConstruct<int&, int const&, int&&>(*ptr, UA_AllocLast, I)));
#if TEST_STD_VER >= 20
- assert((POuter.checkConstruct<
- int&, int const&, int&&,
- const SA::inner_allocator_type&>(O, ptr)));
+ assert((POuter.checkConstruct< int&, int const&, int&&, const SA::inner_allocator_type&>(O, ptr)));
#else
- assert((POuter.checkConstruct<
- int&, int const&, int&&,
- SA::inner_allocator_type&>(O, ptr)));
+ assert((POuter.checkConstruct< int&, int const&, int&&, SA::inner_allocator_type&>(O, ptr)));
#endif
- A.destroy(ptr);
- ::operator delete((void*)ptr);
- }
- PInner.reset();
- POuter.reset();
+ A.destroy(ptr);
+ ::operator delete((void*)ptr);
+ }
+ PInner.reset();
+ POuter.reset();
}
int main(int, char**) {
- test_bullet_one();
- test_bullet_two();
- test_bullet_three();
+ test_bullet_one();
+ test_bullet_two();
+ test_bullet_three();
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/deallocate.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/deallocate.pass.cpp
index 547de83816e67..0d932a702e400 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/deallocate.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/deallocate.pass.cpp
@@ -21,28 +21,25 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
-
- {
- typedef std::scoped_allocator_adaptor<A1<int>> A;
- A a;
- a.deallocate((int*)10, 20);
- assert((A1<int>::deallocate_called == std::pair<int*, std::size_t>((int*)10, 20)));
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
- A a;
- a.deallocate((int*)10, 20);
- assert((A1<int>::deallocate_called == std::pair<int*, std::size_t>((int*)10, 20)));
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
- A a;
- a.deallocate((int*)10, 20);
- assert((A1<int>::deallocate_called == std::pair<int*, std::size_t>((int*)10, 20)));
- }
-
+int main(int, char**) {
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>> A;
+ A a;
+ a.deallocate((int*)10, 20);
+ assert((A1<int>::deallocate_called == std::pair<int*, std::size_t>((int*)10, 20)));
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
+ A a;
+ a.deallocate((int*)10, 20);
+ assert((A1<int>::deallocate_called == std::pair<int*, std::size_t>((int*)10, 20)));
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ A a;
+ a.deallocate((int*)10, 20);
+ assert((A1<int>::deallocate_called == std::pair<int*, std::size_t>((int*)10, 20)));
+ }
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/destroy.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/destroy.pass.cpp
index 5e00910f066c7..f307c236b444e 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/destroy.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/destroy.pass.cpp
@@ -22,50 +22,47 @@
#include "test_macros.h"
#include "allocators.h"
-struct B
-{
- static bool constructed;
+struct B {
+ static bool constructed;
- B() {constructed = true;}
- ~B() {constructed = false;}
+ B() { constructed = true; }
+ ~B() { constructed = false; }
};
bool B::constructed = false;
-int main(int, char**)
-{
- {
- typedef std::scoped_allocator_adaptor<A1<B>> A;
- A a;
- char buf[100];
- typedef B S;
- S* s = (S*)buf;
- assert(!S::constructed);
- a.construct(s);
- assert(S::constructed);
- a.destroy(s);
- assert(!S::constructed);
- }
-
- {
- typedef std::scoped_allocator_adaptor<A3<B>, A1<B>> A;
- A a;
- char buf[100];
- typedef B S;
- S* s = (S*)buf;
- assert(!S::constructed);
- assert(!A3<S>::constructed);
- assert(!A3<S>::destroy_called);
- a.construct(s);
- assert(S::constructed);
- assert(A3<S>::constructed);
- assert(!A3<S>::destroy_called);
- a.destroy(s);
- assert(!S::constructed);
- assert(A3<S>::constructed);
- assert(A3<S>::destroy_called);
- }
+int main(int, char**) {
+ {
+ typedef std::scoped_allocator_adaptor<A1<B>> A;
+ A a;
+ char buf[100];
+ typedef B S;
+ S* s = (S*)buf;
+ assert(!S::constructed);
+ a.construct(s);
+ assert(S::constructed);
+ a.destroy(s);
+ assert(!S::constructed);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A3<B>, A1<B>> A;
+ A a;
+ char buf[100];
+ typedef B S;
+ S* s = (S*)buf;
+ assert(!S::constructed);
+ assert(!A3<S>::constructed);
+ assert(!A3<S>::destroy_called);
+ a.construct(s);
+ assert(S::constructed);
+ assert(A3<S>::constructed);
+ assert(!A3<S>::destroy_called);
+ a.destroy(s);
+ assert(!S::constructed);
+ assert(A3<S>::constructed);
+ assert(A3<S>::destroy_called);
+ }
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/inner_allocator.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/inner_allocator.pass.cpp
index da553d57163d9..b13543c0bf616 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/inner_allocator.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/inner_allocator.pass.cpp
@@ -22,25 +22,22 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- {
- typedef std::scoped_allocator_adaptor<A1<int>> A;
- A a(A1<int>(5));
- assert(a.inner_allocator() == a);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
- A a(A1<int>(5), A2<int>(6));
- assert(a.inner_allocator() == std::scoped_allocator_adaptor<A2<int>>(A2<int>(6)));
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
- A a(A1<int>(5), A2<int>(6), A3<int>(8));
- assert((a.inner_allocator() ==
- std::scoped_allocator_adaptor<A2<int>, A3<int>>(A2<int>(6), A3<int>(8))));
- }
-
+int main(int, char**) {
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>> A;
+ A a(A1<int>(5));
+ assert(a.inner_allocator() == a);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
+ A a(A1<int>(5), A2<int>(6));
+ assert(a.inner_allocator() == std::scoped_allocator_adaptor<A2<int>>(A2<int>(6)));
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ A a(A1<int>(5), A2<int>(6), A3<int>(8));
+ assert((a.inner_allocator() == std::scoped_allocator_adaptor<A2<int>, A3<int>>(A2<int>(6), A3<int>(8))));
+ }
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/max_size.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/max_size.pass.cpp
index 4fa8f92bd0080..b795ae8e81bc9 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/max_size.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/max_size.pass.cpp
@@ -21,24 +21,22 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- {
- typedef std::scoped_allocator_adaptor<A1<int>> A;
- const A a(A1<int>(100));
- assert(a.max_size() == 100);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
- const A a(A1<int>(20), A2<int>());
- assert(a.max_size() == 20);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
- const A a(A1<int>(200), A2<int>(), A3<int>());
- assert(a.max_size() == 200);
- }
-
+int main(int, char**) {
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>> A;
+ const A a(A1<int>(100));
+ assert(a.max_size() == 100);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
+ const A a(A1<int>(20), A2<int>());
+ assert(a.max_size() == 20);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ const A a(A1<int>(200), A2<int>(), A3<int>());
+ assert(a.max_size() == 200);
+ }
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/outer_allocator.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/outer_allocator.pass.cpp
index b98fc96d31d1b..a2001469bd0e9 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/outer_allocator.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/outer_allocator.pass.cpp
@@ -22,24 +22,22 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
-
- {
- typedef std::scoped_allocator_adaptor<A1<int>> A;
- A a(A1<int>(5));
- assert(a.outer_allocator() == A1<int>(5));
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
- A a(A1<int>(5), A2<int>(6));
- assert(a.outer_allocator() == A1<int>(5));
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
- A a(A1<int>(5), A2<int>(6), A3<int>(8));
- assert(a.outer_allocator() == A1<int>(5));
- }
+int main(int, char**) {
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>> A;
+ A a(A1<int>(5));
+ assert(a.outer_allocator() == A1<int>(5));
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
+ A a(A1<int>(5), A2<int>(6));
+ assert(a.outer_allocator() == A1<int>(5));
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ A a(A1<int>(5), A2<int>(6), A3<int>(8));
+ assert(a.outer_allocator() == A1<int>(5));
+ }
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/select_on_container_copy_construction.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/select_on_container_copy_construction.pass.cpp
index b4f52e459b66d..7c9980e50e24c 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/select_on_container_copy_construction.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/select_on_container_copy_construction.pass.cpp
@@ -21,36 +21,34 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- {
- typedef std::scoped_allocator_adaptor<A1<int>> A;
- A a1(A1<int>(3));
- assert(a1.outer_allocator().id() == 3);
- A a2 = std::allocator_traits<A>::select_on_container_copy_construction(a1);
- assert(a2.outer_allocator().id() == 3);
- }
-
- {
- typedef std::scoped_allocator_adaptor<A3<int>> A;
- A a1(A3<int>(3));
- assert(a1.outer_allocator().id() == 3);
- A a2 = std::allocator_traits<A>::select_on_container_copy_construction(a1);
- assert(a2.outer_allocator().id() == -1);
- }
-
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
- A a1(A1<int>(1), A2<int>(2), A3<int>(3));
- assert(a1.outer_allocator().id() == 1);
- assert(a1.inner_allocator().outer_allocator().id() == 2);
- assert(a1.inner_allocator().inner_allocator().outer_allocator().id() == 3);
- A a2 = std::allocator_traits<A>::select_on_container_copy_construction(a1);
- assert(a2.outer_allocator().id() == 1);
- assert(a2.inner_allocator().outer_allocator().id() == 2);
- assert(a2.inner_allocator().inner_allocator().outer_allocator().id() == -1);
- }
-
+int main(int, char**) {
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>> A;
+ A a1(A1<int>(3));
+ assert(a1.outer_allocator().id() == 3);
+ A a2 = std::allocator_traits<A>::select_on_container_copy_construction(a1);
+ assert(a2.outer_allocator().id() == 3);
+ }
+
+ {
+ typedef std::scoped_allocator_adaptor<A3<int>> A;
+ A a1(A3<int>(3));
+ assert(a1.outer_allocator().id() == 3);
+ A a2 = std::allocator_traits<A>::select_on_container_copy_construction(a1);
+ assert(a2.outer_allocator().id() == -1);
+ }
+
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ A a1(A1<int>(1), A2<int>(2), A3<int>(3));
+ assert(a1.outer_allocator().id() == 1);
+ assert(a1.inner_allocator().outer_allocator().id() == 2);
+ assert(a1.inner_allocator().inner_allocator().outer_allocator().id() == 3);
+ A a2 = std::allocator_traits<A>::select_on_container_copy_construction(a1);
+ assert(a2.outer_allocator().id() == 1);
+ assert(a2.inner_allocator().outer_allocator().id() == 2);
+ assert(a2.inner_allocator().inner_allocator().outer_allocator().id() == -1);
+ }
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/allocator_pointers.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/allocator_pointers.pass.cpp
index c96c208a3d02c..9d46c8ab20f22 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/allocator_pointers.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/allocator_pointers.pass.cpp
@@ -35,90 +35,89 @@
// const_void_pointer;
template <typename Alloc>
-void test_pointer()
-{
- typename std::allocator_traits<Alloc>::pointer vp;
- typename std::allocator_traits<Alloc>::const_pointer cvp;
-
- ((void)vp); // Prevent unused warning
- ((void)cvp); // Prevent unused warning
-
- static_assert(std::is_same<bool, decltype( vp == vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp != vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp > vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp >= vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp < vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp <= vp)>::value, "");
-
- static_assert(std::is_same<bool, decltype( vp == cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp == vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp != cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp != vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp > cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp > vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp >= cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp >= vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp < cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp < vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp <= cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp <= vp)>::value, "");
-
- static_assert(std::is_same<bool, decltype(cvp == cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp != cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp > cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp >= cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp < cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp <= cvp)>::value, "");
+void test_pointer() {
+ typename std::allocator_traits<Alloc>::pointer vp;
+ typename std::allocator_traits<Alloc>::const_pointer cvp;
+
+ ((void)vp); // Prevent unused warning
+ ((void)cvp); // Prevent unused warning
+
+ static_assert(std::is_same<bool, decltype(vp == vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp != vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp > vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp >= vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp < vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp <= vp)>::value, "");
+
+ static_assert(std::is_same<bool, decltype(vp == cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp == vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp != cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp != vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp > cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp > vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp >= cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp >= vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp < cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp < vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp <= cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp <= vp)>::value, "");
+
+ static_assert(std::is_same<bool, decltype(cvp == cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp != cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp > cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp >= cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp < cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp <= cvp)>::value, "");
}
template <typename Alloc>
-void test_void_pointer()
-{
- typename std::allocator_traits<Alloc>::void_pointer vp;
- typename std::allocator_traits<Alloc>::const_void_pointer cvp;
-
- ((void)vp); // Prevent unused warning
- ((void)cvp); // Prevent unused warning
-
- static_assert(std::is_same<bool, decltype( vp == vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp != vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp > vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp >= vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp < vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp <= vp)>::value, "");
-
- static_assert(std::is_same<bool, decltype( vp == cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp == vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp != cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp != vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp > cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp > vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp >= cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp >= vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp < cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp < vp)>::value, "");
- static_assert(std::is_same<bool, decltype( vp <= cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp <= vp)>::value, "");
-
- static_assert(std::is_same<bool, decltype(cvp == cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp != cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp > cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp >= cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp < cvp)>::value, "");
- static_assert(std::is_same<bool, decltype(cvp <= cvp)>::value, "");
+void test_void_pointer() {
+ typename std::allocator_traits<Alloc>::void_pointer vp;
+ typename std::allocator_traits<Alloc>::const_void_pointer cvp;
+
+ ((void)vp); // Prevent unused warning
+ ((void)cvp); // Prevent unused warning
+
+ static_assert(std::is_same<bool, decltype(vp == vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp != vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp > vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp >= vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp < vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp <= vp)>::value, "");
+
+ static_assert(std::is_same<bool, decltype(vp == cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp == vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp != cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp != vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp > cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp > vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp >= cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp >= vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp < cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp < vp)>::value, "");
+ static_assert(std::is_same<bool, decltype(vp <= cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp <= vp)>::value, "");
+
+ static_assert(std::is_same<bool, decltype(cvp == cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp != cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp > cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp >= cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp < cvp)>::value, "");
+ static_assert(std::is_same<bool, decltype(cvp <= cvp)>::value, "");
}
-struct Foo { int x; };
+struct Foo {
+ int x;
+};
-int main(int, char**)
-{
- test_pointer<std::scoped_allocator_adaptor<std::allocator<char>>> ();
- test_pointer<std::scoped_allocator_adaptor<std::allocator<int>>> ();
- test_pointer<std::scoped_allocator_adaptor<std::allocator<Foo>>> ();
+int main(int, char**) {
+ test_pointer<std::scoped_allocator_adaptor<std::allocator<char>>>();
+ test_pointer<std::scoped_allocator_adaptor<std::allocator<int>>>();
+ test_pointer<std::scoped_allocator_adaptor<std::allocator<Foo>>>();
- test_void_pointer<std::scoped_allocator_adaptor<std::allocator<char>>> ();
- test_void_pointer<std::scoped_allocator_adaptor<std::allocator<int>>> ();
- test_void_pointer<std::scoped_allocator_adaptor<std::allocator<Foo>>> ();
+ test_void_pointer<std::scoped_allocator_adaptor<std::allocator<char>>>();
+ test_void_pointer<std::scoped_allocator_adaptor<std::allocator<int>>>();
+ test_void_pointer<std::scoped_allocator_adaptor<std::allocator<Foo>>>();
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/inner_allocator_type.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/inner_allocator_type.pass.cpp
index 7503a368bef6f..1f5769ddaad0d 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/inner_allocator_type.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/inner_allocator_type.pass.cpp
@@ -21,19 +21,18 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>>::inner_allocator_type,
- std::scoped_allocator_adaptor<A1<int>>>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>, A2<int>>::inner_allocator_type,
- std::scoped_allocator_adaptor<A2<int>>>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>>::inner_allocator_type,
- std::scoped_allocator_adaptor<A2<int>, A3<int>>>::value), "");
+int main(int, char**) {
+ static_assert((std::is_same< std::scoped_allocator_adaptor<A1<int>>::inner_allocator_type,
+ std::scoped_allocator_adaptor<A1<int>>>::value),
+ "");
+
+ static_assert((std::is_same< std::scoped_allocator_adaptor<A1<int>, A2<int>>::inner_allocator_type,
+ std::scoped_allocator_adaptor<A2<int>>>::value),
+ "");
+
+ static_assert((std::is_same< std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>>::inner_allocator_type,
+ std::scoped_allocator_adaptor<A2<int>, A3<int>>>::value),
+ "");
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/is_always_equal.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/is_always_equal.pass.cpp
index 14affd4e5e401..a091647a69002 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/is_always_equal.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/is_always_equal.pass.cpp
@@ -22,53 +22,40 @@
#include "allocators.h"
#include "min_allocator.h"
-int main(int, char**)
-{
- // sanity checks
- static_assert( (std::is_same<
- std::allocator_traits<A1<int>>::is_always_equal, std::false_type>::value
- ), "" );
-
- static_assert( (std::is_same<
- std::allocator_traits<min_allocator<int>>::is_always_equal, std::true_type>::value
- ), "" );
-
- // wrapping one allocator
- static_assert(
- (std::is_same<
- std::scoped_allocator_adaptor<A1<int>>::is_always_equal,
- std::allocator_traits<A1<int>>::is_always_equal
- >::value), "");
-
- // wrapping one allocator
- static_assert(
- (std::is_same<
- std::scoped_allocator_adaptor<min_allocator<int>>::is_always_equal,
- std::allocator_traits<min_allocator<int>>::is_always_equal
- >::value), "");
-
- // wrapping two allocators (check the values instead of the types)
- static_assert((
- std::scoped_allocator_adaptor<A1<int>, A2<int>>::is_always_equal::value ==
- ( std::allocator_traits<A1<int>>::is_always_equal::value &&
- std::allocator_traits<A2<int>>::is_always_equal::value)
- ), "");
-
- // wrapping two allocators (check the values instead of the types)
- static_assert((
- std::scoped_allocator_adaptor<A1<int>, min_allocator<int>>::is_always_equal::value ==
- ( std::allocator_traits<A1<int>>::is_always_equal::value &&
- std::allocator_traits<min_allocator<int>>::is_always_equal::value)
- ), "");
-
-
- // wrapping three allocators (check the values instead of the types)
- static_assert((
- std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>>::is_always_equal::value ==
- ( std::allocator_traits<A1<int>>::is_always_equal::value &&
- std::allocator_traits<A2<int>>::is_always_equal::value &&
- std::allocator_traits<A3<int>>::is_always_equal::value)
- ), "");
+int main(int, char**) {
+ // sanity checks
+ static_assert((std::is_same< std::allocator_traits<A1<int>>::is_always_equal, std::false_type>::value), "");
+
+ static_assert((std::is_same< std::allocator_traits<min_allocator<int>>::is_always_equal, std::true_type>::value), "");
+
+ // wrapping one allocator
+ static_assert((std::is_same< std::scoped_allocator_adaptor<A1<int>>::is_always_equal,
+ std::allocator_traits<A1<int>>::is_always_equal >::value),
+ "");
+
+ // wrapping one allocator
+ static_assert((std::is_same< std::scoped_allocator_adaptor<min_allocator<int>>::is_always_equal,
+ std::allocator_traits<min_allocator<int>>::is_always_equal >::value),
+ "");
+
+ // wrapping two allocators (check the values instead of the types)
+ static_assert((std::scoped_allocator_adaptor<A1<int>, A2<int>>::is_always_equal::value ==
+ (std::allocator_traits<A1<int>>::is_always_equal::value &&
+ std::allocator_traits<A2<int>>::is_always_equal::value)),
+ "");
+
+ // wrapping two allocators (check the values instead of the types)
+ static_assert((std::scoped_allocator_adaptor<A1<int>, min_allocator<int>>::is_always_equal::value ==
+ (std::allocator_traits<A1<int>>::is_always_equal::value &&
+ std::allocator_traits<min_allocator<int>>::is_always_equal::value)),
+ "");
+
+ // wrapping three allocators (check the values instead of the types)
+ static_assert((std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>>::is_always_equal::value ==
+ (std::allocator_traits<A1<int>>::is_always_equal::value &&
+ std::allocator_traits<A2<int>>::is_always_equal::value &&
+ std::allocator_traits<A3<int>>::is_always_equal::value)),
+ "");
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_copy_assignment.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_copy_assignment.pass.cpp
index fe89cc6f661db..ae01d0daf1b08 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_copy_assignment.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_copy_assignment.pass.cpp
@@ -21,20 +21,19 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>>::propagate_on_container_copy_assignment,
- std::false_type>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>, A2<int>>::propagate_on_container_copy_assignment,
- std::false_type>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>>::propagate_on_container_copy_assignment,
- std::true_type>::value), "");
-
+int main(int, char**) {
+ static_assert((std::is_same< std::scoped_allocator_adaptor<A1<int>>::propagate_on_container_copy_assignment,
+ std::false_type>::value),
+ "");
+
+ static_assert((std::is_same< std::scoped_allocator_adaptor<A1<int>, A2<int>>::propagate_on_container_copy_assignment,
+ std::false_type>::value),
+ "");
+
+ static_assert(
+ (std::is_same< std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>>::propagate_on_container_copy_assignment,
+ std::true_type>::value),
+ "");
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_move_assignment.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_move_assignment.pass.cpp
index e9c7e7b33c0c2..5e47df6692943 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_move_assignment.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_move_assignment.pass.cpp
@@ -21,20 +21,19 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>>::propagate_on_container_move_assignment,
- std::false_type>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>, A2<int>>::propagate_on_container_move_assignment,
- std::true_type>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>>::propagate_on_container_move_assignment,
- std::true_type>::value), "");
-
+int main(int, char**) {
+ static_assert((std::is_same< std::scoped_allocator_adaptor<A1<int>>::propagate_on_container_move_assignment,
+ std::false_type>::value),
+ "");
+
+ static_assert((std::is_same< std::scoped_allocator_adaptor<A1<int>, A2<int>>::propagate_on_container_move_assignment,
+ std::true_type>::value),
+ "");
+
+ static_assert(
+ (std::is_same< std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>>::propagate_on_container_move_assignment,
+ std::true_type>::value),
+ "");
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_swap.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_swap.pass.cpp
index f761a28f54c56..7264293efcefe 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_swap.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/propagate_on_container_swap.pass.cpp
@@ -21,19 +21,17 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>>::propagate_on_container_swap,
- std::false_type>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>, A2<int>>::propagate_on_container_swap,
- std::false_type>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>>::propagate_on_container_swap,
- std::true_type>::value), "");
+int main(int, char**) {
+ static_assert(
+ (std::is_same< std::scoped_allocator_adaptor<A1<int>>::propagate_on_container_swap, std::false_type>::value), "");
+
+ static_assert((std::is_same< std::scoped_allocator_adaptor<A1<int>, A2<int>>::propagate_on_container_swap,
+ std::false_type>::value),
+ "");
+
+ static_assert((std::is_same< std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>>::propagate_on_container_swap,
+ std::true_type>::value),
+ "");
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/copy_assign.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/copy_assign.pass.cpp
index 89acb89d3f8ad..748086e064698 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/copy_assign.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/copy_assign.pass.cpp
@@ -15,60 +15,58 @@
// scoped_allocator_adaptor& operator=(const scoped_allocator_adaptor& other);
-
#include <scoped_allocator>
#include <cassert>
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- {
- typedef std::scoped_allocator_adaptor<A1<int>> A;
- A a1(A1<int>(3));
- A aN;
- A1<int>::copy_called = false;
- A1<int>::move_called = false;
- aN = a1;
- assert(A1<int>::copy_called == true);
- assert(A1<int>::move_called == false);
- assert(aN == a1);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
- A a1(A1<int>(4), A2<int>(5));
- A aN;
- A1<int>::copy_called = false;
- A1<int>::move_called = false;
- A2<int>::copy_called = false;
- A2<int>::move_called = false;
- aN = a1;
- assert(A1<int>::copy_called == true);
- assert(A1<int>::move_called == false);
- assert(A2<int>::copy_called == true);
- assert(A2<int>::move_called == false);
- assert(aN == a1);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
- A a1(A1<int>(4), A2<int>(5), A3<int>(6));
- A aN;
- A1<int>::copy_called = false;
- A1<int>::move_called = false;
- A2<int>::copy_called = false;
- A2<int>::move_called = false;
- A3<int>::copy_called = false;
- A3<int>::move_called = false;
- aN = a1;
- assert(A1<int>::copy_called == true);
- assert(A1<int>::move_called == false);
- assert(A2<int>::copy_called == true);
- assert(A2<int>::move_called == false);
- assert(A3<int>::copy_called == true);
- assert(A3<int>::move_called == false);
- assert(aN == a1);
- }
+int main(int, char**) {
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>> A;
+ A a1(A1<int>(3));
+ A aN;
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ aN = a1;
+ assert(A1<int>::copy_called == true);
+ assert(A1<int>::move_called == false);
+ assert(aN == a1);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
+ A a1(A1<int>(4), A2<int>(5));
+ A aN;
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A2<int>::copy_called = false;
+ A2<int>::move_called = false;
+ aN = a1;
+ assert(A1<int>::copy_called == true);
+ assert(A1<int>::move_called == false);
+ assert(A2<int>::copy_called == true);
+ assert(A2<int>::move_called == false);
+ assert(aN == a1);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ A a1(A1<int>(4), A2<int>(5), A3<int>(6));
+ A aN;
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A2<int>::copy_called = false;
+ A2<int>::move_called = false;
+ A3<int>::copy_called = false;
+ A3<int>::move_called = false;
+ aN = a1;
+ assert(A1<int>::copy_called == true);
+ assert(A1<int>::move_called == false);
+ assert(A2<int>::copy_called == true);
+ assert(A2<int>::move_called == false);
+ assert(A3<int>::copy_called == true);
+ assert(A3<int>::move_called == false);
+ assert(aN == a1);
+ }
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/eq.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/eq.pass.cpp
index 706e22ab54972..46b53b0e383d7 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/eq.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/eq.pass.cpp
@@ -29,36 +29,35 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- {
- typedef std::scoped_allocator_adaptor<A1<int>> A;
- A a1(A1<int>(3));
- A a2 = a1;
- assert(a2 == a1);
- assert(!(a2 != a1));
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
- A a1(A1<int>(4), A2<int>(5));
- A a2 = a1;
- assert(a2 == a1);
- assert(!(a2 != a1));
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
- A a1(A1<int>(4), A2<int>(5), A3<int>(6));
- A a2 = a1;
- assert(a2 == a1);
- assert(!(a2 != a1));
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
- A a1(A1<int>(4), A2<int>(5), A3<int>(6));
- A a2(A1<int>(4), A2<int>(5), A3<int>(5));
- assert(a2 != a1);
- assert(!(a2 == a1));
- }
+int main(int, char**) {
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>> A;
+ A a1(A1<int>(3));
+ A a2 = a1;
+ assert(a2 == a1);
+ assert(!(a2 != a1));
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
+ A a1(A1<int>(4), A2<int>(5));
+ A a2 = a1;
+ assert(a2 == a1);
+ assert(!(a2 != a1));
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ A a1(A1<int>(4), A2<int>(5), A3<int>(6));
+ A a2 = a1;
+ assert(a2 == a1);
+ assert(!(a2 != a1));
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ A a1(A1<int>(4), A2<int>(5), A3<int>(6));
+ A a2(A1<int>(4), A2<int>(5), A3<int>(5));
+ assert(a2 != a1);
+ assert(!(a2 == a1));
+ }
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/move_assign.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/move_assign.pass.cpp
index 102a602dd1265..ab2fb63755229 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/move_assign.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/scoped.adaptor.operators/move_assign.pass.cpp
@@ -15,60 +15,58 @@
// scoped_allocator_adaptor& operator=(const scoped_allocator_adaptor&& other);
-
#include <scoped_allocator>
#include <cassert>
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- {
- typedef std::scoped_allocator_adaptor<A1<int>> A;
- A a1(A1<int>(3));
- A aN;
- A1<int>::copy_called = false;
- A1<int>::move_called = false;
- aN = std::move(a1);
- assert(A1<int>::copy_called == false);
- assert(A1<int>::move_called == true);
- assert(aN == a1);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
- A a1(A1<int>(4), A2<int>(5));
- A aN;
- A1<int>::copy_called = false;
- A1<int>::move_called = false;
- A2<int>::copy_called = false;
- A2<int>::move_called = false;
- aN = std::move(a1);
- assert(A1<int>::copy_called == false);
- assert(A1<int>::move_called == true);
- assert(A2<int>::copy_called == false);
- assert(A2<int>::move_called == true);
- assert(aN == a1);
- }
- {
- typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
- A a1(A1<int>(4), A2<int>(5), A3<int>(6));
- A aN;
- A1<int>::copy_called = false;
- A1<int>::move_called = false;
- A2<int>::copy_called = false;
- A2<int>::move_called = false;
- A3<int>::copy_called = false;
- A3<int>::move_called = false;
- aN = std::move(a1);
- assert(A1<int>::copy_called == false);
- assert(A1<int>::move_called == true);
- assert(A2<int>::copy_called == false);
- assert(A2<int>::move_called == true);
- assert(A3<int>::copy_called == false);
- assert(A3<int>::move_called == true);
- assert(aN == a1);
- }
+int main(int, char**) {
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>> A;
+ A a1(A1<int>(3));
+ A aN;
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ aN = std::move(a1);
+ assert(A1<int>::copy_called == false);
+ assert(A1<int>::move_called == true);
+ assert(aN == a1);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
+ A a1(A1<int>(4), A2<int>(5));
+ A aN;
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A2<int>::copy_called = false;
+ A2<int>::move_called = false;
+ aN = std::move(a1);
+ assert(A1<int>::copy_called == false);
+ assert(A1<int>::move_called == true);
+ assert(A2<int>::copy_called == false);
+ assert(A2<int>::move_called == true);
+ assert(aN == a1);
+ }
+ {
+ typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
+ A a1(A1<int>(4), A2<int>(5), A3<int>(6));
+ A aN;
+ A1<int>::copy_called = false;
+ A1<int>::move_called = false;
+ A2<int>::copy_called = false;
+ A2<int>::move_called = false;
+ A3<int>::copy_called = false;
+ A3<int>::move_called = false;
+ aN = std::move(a1);
+ assert(A1<int>::copy_called == false);
+ assert(A1<int>::move_called == true);
+ assert(A2<int>::copy_called == false);
+ assert(A2<int>::move_called == true);
+ assert(A3<int>::copy_called == false);
+ assert(A3<int>::move_called == true);
+ assert(aN == a1);
+ }
return 0;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/types.pass.cpp b/libcxx/test/std/utilities/allocator.adaptor/types.pass.cpp
index 13f1343190e19..7682409846231 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/types.pass.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/types.pass.cpp
@@ -30,73 +30,42 @@
#include "test_macros.h"
#include "allocators.h"
-int main(int, char**)
-{
- static_assert((std::is_base_of<
- A1<int>,
- std::scoped_allocator_adaptor<A1<int>>
- >::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>>::outer_allocator_type,
- A1<int>>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>>::size_type,
- std::make_unsigned<std::ptr
diff _t>::type>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>>::
diff erence_type,
- std::ptr
diff _t>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>>::pointer,
- int*>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>>::const_pointer,
- const int*>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>>::void_pointer,
- void*>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A1<int>>::const_void_pointer,
- const void*>::value), "");
-
- static_assert((std::is_base_of<
- A2<int>,
- std::scoped_allocator_adaptor<A2<int>, A1<int>>
- >::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A2<int>, A1<int>>::outer_allocator_type,
- A2<int>>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A2<int>, A1<int>>::size_type,
- unsigned>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A2<int>, A1<int>>::
diff erence_type,
- int>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A2<int>, A1<int>>::pointer,
- int*>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A2<int>, A1<int>>::const_pointer,
- const int*>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A2<int>, A1<int>>::void_pointer,
- void*>::value), "");
-
- static_assert((std::is_same<
- std::scoped_allocator_adaptor<A2<int>, A1<int>>::const_void_pointer,
- const void*>::value), "");
+int main(int, char**) {
+ static_assert(std::is_base_of<A1<int>, std::scoped_allocator_adaptor<A1<int>> >::value, "");
+
+ static_assert(std::is_same<std::scoped_allocator_adaptor<A1<int>>::outer_allocator_type, A1<int>>::value, "");
+
+ static_assert(
+ std::is_same<std::scoped_allocator_adaptor<A1<int>>::size_type, std::make_unsigned<std::ptr
diff _t>::type>::value,
+ "");
+
+ static_assert(std::is_same<std::scoped_allocator_adaptor<A1<int>>::
diff erence_type, std::ptr
diff _t>::value, "");
+
+ static_assert(std::is_same<std::scoped_allocator_adaptor<A1<int>>::pointer, int*>::value, "");
+
+ static_assert(std::is_same<std::scoped_allocator_adaptor<A1<int>>::const_pointer, const int*>::value, "");
+
+ static_assert(std::is_same<std::scoped_allocator_adaptor<A1<int>>::void_pointer, void*>::value, "");
+
+ static_assert(std::is_same<std::scoped_allocator_adaptor<A1<int>>::const_void_pointer, const void*>::value, "");
+
+ static_assert(std::is_base_of<A2<int>, std::scoped_allocator_adaptor<A2<int>, A1<int>> >::value, "");
+
+ static_assert(
+ std::is_same<std::scoped_allocator_adaptor<A2<int>, A1<int>>::outer_allocator_type, A2<int>>::value, "");
+
+ static_assert(std::is_same<std::scoped_allocator_adaptor<A2<int>, A1<int>>::size_type, unsigned>::value, "");
+
+ static_assert(std::is_same<std::scoped_allocator_adaptor<A2<int>, A1<int>>::
diff erence_type, int>::value, "");
+
+ static_assert(std::is_same<std::scoped_allocator_adaptor<A2<int>, A1<int>>::pointer, int*>::value, "");
+
+ static_assert(std::is_same<std::scoped_allocator_adaptor<A2<int>, A1<int>>::const_pointer, const int*>::value, "");
+
+ static_assert(std::is_same<std::scoped_allocator_adaptor<A2<int>, A1<int>>::void_pointer, void*>::value, "");
+
+ static_assert(
+ std::is_same<std::scoped_allocator_adaptor<A2<int>, A1<int>>::const_void_pointer, const void*>::value, "");
return 0;
}
More information about the libcxx-commits
mailing list