diff options
Diffstat (limited to 'libcxx/test/std/utilities/expected/expected.void/swap/member.swap.pass.cpp')
-rw-r--r-- | libcxx/test/std/utilities/expected/expected.void/swap/member.swap.pass.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libcxx/test/std/utilities/expected/expected.void/swap/member.swap.pass.cpp b/libcxx/test/std/utilities/expected/expected.void/swap/member.swap.pass.cpp index 07980de..25601af 100644 --- a/libcxx/test/std/utilities/expected/expected.void/swap/member.swap.pass.cpp +++ b/libcxx/test/std/utilities/expected/expected.void/swap/member.swap.pass.cpp @@ -139,6 +139,28 @@ constexpr bool test() { assert(y.has_value()); } + // CheckForInvalidWrites + { + { + CheckForInvalidWrites<true, true> x(std::unexpect); + CheckForInvalidWrites<true, true> y; + + x.swap(y); + + assert(x.check()); + assert(y.check()); + } + { + CheckForInvalidWrites<false, true> x(std::unexpect); + CheckForInvalidWrites<false, true> y; + + x.swap(y); + + assert(x.check()); + assert(y.check()); + } + } + return true; } |