Skip to content

Commit 63e4c45

Browse files
committed
use LIBCPP_STATIC_ASSERT to check size of std::expected containing a TailClobberer
1 parent 737f6dd commit 63e4c45

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libcxx/test/std/utilities/expected/expected.expected/observers/has_value.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ constexpr bool test() {
7070
const std::expected<TailClobberer<0>, bool> e = {};
7171
// clang-cl does not support [[no_unique_address]] yet.
7272
#if !(defined(TEST_COMPILER_CLANG) && defined(_MSC_VER))
73-
static_assert(sizeof(TailClobberer<0>) == sizeof(e));
73+
LIBCPP_STATIC_ASSERT(sizeof(TailClobberer<0>) == sizeof(e));
7474
#endif
7575
assert(e.has_value());
7676
}

libcxx/test/std/utilities/expected/expected.void/observers/has_value.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ constexpr bool test() {
5050
const std::expected<void, TailClobberer<1>> e(std::unexpect);
5151
// clang-cl does not support [[no_unique_address]] yet.
5252
#if !(defined(TEST_COMPILER_CLANG) && defined(_MSC_VER))
53-
static_assert(sizeof(TailClobberer<1>) == sizeof(e));
53+
LIBCPP_STATIC_ASSERT(sizeof(TailClobberer<1>) == sizeof(e));
5454
#endif
5555
assert(!e.has_value());
5656
}

0 commit comments

Comments
 (0)