From 56b0b4590dd6739ef086b493b1cd2b92ac09cff9 Mon Sep 17 00:00:00 2001 From: Borislav Stanimirov Date: Fri, 21 Apr 2023 14:13:12 +0300 Subject: [PATCH] tests: fixed test-specific UB --- test/t-make_ptr-11.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/t-make_ptr-11.cpp b/test/t-make_ptr-11.cpp index f711cce..6a92089 100644 --- a/test/t-make_ptr-11.cpp +++ b/test/t-make_ptr-11.cpp @@ -48,7 +48,8 @@ TEST_CASE("[make-ptr:make_aliased]") // null { std::shared_ptr ptr; - auto alias = itlib::make_aliased(ptr, &ptr->y); + int val = 5; + auto alias = itlib::make_aliased(ptr, &val); CHECK_FALSE(alias); CHECK(alias.use_count() == 0); }