Skip to content

Commit 3ee50e8

Browse files
committed
tests: support C++23 in tests
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent 22caae1 commit 3ee50e8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/pure_cpp/smart_holder_poc_test.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "smart_holder_poc.h"
22

3+
#include <cstddef>
34
#include <functional>
45
#include <memory>
56
#include <type_traits>
@@ -380,8 +381,15 @@ TEST_CASE("error_cannot_disown_nullptr", "[E]") {
380381

381382
TEST_CASE("indestructible_int-from_raw_ptr_unowned+as_raw_ptr_unowned", "[S]") {
382383
using zombie = helpers::indestructible_int;
384+
//
385+
#ifdef __cpp_lib_byte
386+
using raw_byte = std::byte;
387+
#else
388+
using raw_byte = char;
389+
#endif
383390
// Using placement new instead of plain new, to not trigger leak sanitizer errors.
384-
static std::aligned_storage<sizeof(zombie), alignof(zombie)>::type memory_block[1];
391+
alignas(zombie) raw_byte memory_block[sizeof(zombie)];
392+
385393
auto *value = new (memory_block) zombie(19);
386394
auto hld = smart_holder::from_raw_ptr_unowned(value);
387395
REQUIRE(hld.as_raw_ptr_unowned<zombie>()->valu == 19);

0 commit comments

Comments
 (0)