From 5c9f5150fb0b140f456e6700863806bbb541e126 Mon Sep 17 00:00:00 2001 From: Jeremy Rifkin <51220084+jeremy-rifkin@users.noreply.github.com> Date: Mon, 11 Nov 2024 22:41:58 -0600 Subject: [PATCH] Followup fixes --- test/unit/from_current.cpp | 4 +++- test/unit/from_current_z.cpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test/unit/from_current.cpp b/test/unit/from_current.cpp index c5ee358..ce1e802 100644 --- a/test/unit/from_current.cpp +++ b/test/unit/from_current.cpp @@ -42,7 +42,8 @@ TEST(FromCurrent, Basic) { std::vector line_numbers; CPPTRACE_TRY { line_numbers.insert(line_numbers.begin(), __LINE__ + 1); - stacktrace_from_current_1(line_numbers); + static volatile int tco_guard = stacktrace_from_current_1(line_numbers); + (void)tco_guard; } CPPTRACE_CATCH(const std::runtime_error& e) { EXPECT_EQ(e.what(), "foobar"sv); const auto& trace = cpptrace::from_current_exception(); @@ -124,6 +125,7 @@ TEST(FromCurrent, RawTrace) { CPPTRACE_TRY { line_numbers.insert(line_numbers.begin(), __LINE__ + 1); static volatile int tco_guard = stacktrace_from_current_1(line_numbers); + (void)tco_guard; } CPPTRACE_CATCH(const std::exception& e) { EXPECT_EQ(e.what(), "foobar"sv); const auto& raw_trace = cpptrace::raw_trace_from_current_exception(); diff --git a/test/unit/from_current_z.cpp b/test/unit/from_current_z.cpp index 68e25f0..30d88da 100644 --- a/test/unit/from_current_z.cpp +++ b/test/unit/from_current_z.cpp @@ -43,6 +43,7 @@ TEST(FromCurrentZ, Basic) { CPPTRACE_TRYZ { line_numbers.insert(line_numbers.begin(), __LINE__ + 1); static volatile int tco_guard = stacktrace_from_current_z_1(line_numbers); + (void)tco_guard; } CPPTRACE_CATCHZ(const std::runtime_error& e) { EXPECT_EQ(e.what(), "foobar"sv); const auto& trace = cpptrace::from_current_exception();