diff options
Diffstat (limited to 'test/std/utilities')
7 files changed, 33 insertions, 7 deletions
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp index 2aa19c6188a5..f18ed6e2bf0b 100644 --- a/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp +++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp @@ -111,7 +111,7 @@ int main() { 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<A1<int>>, std::scoped_allocator_adaptor<A2<int>>>::value, ""); } } diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp index 7516b2e3af2b..faf4f11573d1 100644 --- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp +++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp @@ -12,7 +12,7 @@ // class function<R(ArgTypes...)> // function(const function& f); -// function(const function&& f); +// function(function&& f); #include <functional> #include <memory> diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp index 82acdd9d7758..55c2156300fb 100644 --- a/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp +++ b/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp @@ -157,7 +157,7 @@ int main() test<int>(3); static_assert(constexpr_test<int>(), "" ); static_assert(constexpr_test<int>(3), "" ); - + { optional<const int> o(42); optional<const int> o2(std::move(o)); diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/dtor.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/dtor.pass.cpp index d7b184f6383c..b4fd2e26425a 100644 --- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/dtor.pass.cpp +++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/dtor.pass.cpp @@ -16,7 +16,7 @@ // ~tuple(); // C++17 added: -// The destructor of tuple shall be a trivial destructor +// The destructor of tuple shall be a trivial destructor // if (is_trivially_destructible_v<Types> && ...) is true. #include <tuple> diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp index aadbf3d5a369..03fb78caa08e 100644 --- a/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp +++ b/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp @@ -64,18 +64,22 @@ void test_decomp_tuple() { void test_decomp_pair() { typedef std::pair<int, double> T; { - T s{99, 42.1}; + T s{99, 42.5}; auto [m1, m2] = s; auto& [r1, r2] = s; assert(m1 == 99); + assert(m2 == 42.5); assert(&r1 == &std::get<0>(s)); + assert(&r2 == &std::get<1>(s)); } { - T const s{99, 42.1}; + T const s{99, 42.5}; auto [m1, m2] = s; auto& [r1, r2] = s; assert(m1 == 99); + assert(m2 == 42.5); assert(&r1 == &std::get<0>(s)); + assert(&r2 == &std::get<1>(s)); } } @@ -86,14 +90,22 @@ void test_decomp_array() { auto [m1, m2, m3] = s; auto& [r1, r2, r3] = s; assert(m1 == 99); + assert(m2 == 42); + assert(m3 == -1); assert(&r1 == &std::get<0>(s)); + assert(&r2 == &std::get<1>(s)); + assert(&r3 == &std::get<2>(s)); } { T const s{{99, 42, -1}}; auto [m1, m2, m3] = s; auto& [r1, r2, r3] = s; assert(m1 == 99); + assert(m2 == 42); + assert(m3 == -1); assert(&r1 == &std::get<0>(s)); + assert(&r2 == &std::get<1>(s)); + assert(&r3 == &std::get<2>(s)); } } diff --git a/test/std/utilities/utility/pairs/pairs.pair/dtor.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/dtor.pass.cpp index 83c55e75b4d2..b25099f4d2e8 100644 --- a/test/std/utilities/utility/pairs/pairs.pair/dtor.pass.cpp +++ b/test/std/utilities/utility/pairs/pairs.pair/dtor.pass.cpp @@ -16,7 +16,7 @@ // ~pair() // C++17 added: -// The destructor of pair shall be a trivial destructor +// The destructor of pair shall be a trivial destructor // if (is_trivially_destructible_v<T1> && is_trivially_destructible_v<T2>) is true. diff --git a/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp b/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp index d33ea0bd3f4e..3f7cd4f0b6d2 100644 --- a/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp +++ b/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp @@ -37,6 +37,9 @@ struct NoThrowT { NoThrowT(int) noexcept(true) {} }; +struct AnyConstructible { template <typename T> AnyConstructible(T&&) {} }; +struct NoConstructible { NoConstructible() = delete; }; + void test_T_ctor_noexcept() { { using V = std::variant<Dummy, NoThrowT>; @@ -62,6 +65,17 @@ void test_T_ctor_sfinae() { static_assert(!std::is_constructible<V, int>::value, "no matching constructor"); } + { + using V = std::variant<AnyConstructible, NoConstructible>; + static_assert( + !std::is_constructible<V, std::in_place_type_t<NoConstructible>>::value, + "no matching constructor"); + static_assert(!std::is_constructible<V, std::in_place_index_t<1>>::value, + "no matching constructor"); + } + + + #if !defined(TEST_VARIANT_HAS_NO_REFERENCES) { using V = std::variant<int, int &&>; |
