Skip to content

Commit cd5dff2

Browse files
committed
test for write to trivial
1 parent 5b79596 commit cd5dff2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/src/test_constexpr.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <memory>
2+
3+
#include <catch2/catch_test_macros.hpp>
4+
5+
namespace {
6+
7+
consteval auto cons() -> bool {
8+
int x = 4;
9+
std::construct_at(&x, 3);
10+
return x == 3;
11+
}
12+
13+
} // namespace
14+
15+
TEST_CASE("Test construct", "[constexpr]") { REQUIRE(cons()); }

0 commit comments

Comments
 (0)