From c50f2215e8e9fe36c4183e8950655d865bccac82 Mon Sep 17 00:00:00 2001 From: bneradt Date: Wed, 17 Jun 2026 16:02:38 -0500 Subject: [PATCH] Fix txn_box unused find result Clang 22 treats the ignored std::unordered_map::find result in the txn_box unit perf test as a warning, and the project builds with warnings promoted to errors. The test therefore fails to compile even though the lookup is intentionally only being timed. This explicitly discards the lookup result in the benchmark lambda and corrects the printed label to describe the lookup operation. --- plugins/experimental/txn_box/unit_tests/test_accl_utils.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/experimental/txn_box/unit_tests/test_accl_utils.cc b/plugins/experimental/txn_box/unit_tests/test_accl_utils.cc index 1359a1c0f1e..ccc998e870b 100644 --- a/plugins/experimental/txn_box/unit_tests/test_accl_utils.cc +++ b/plugins/experimental/txn_box/unit_tests/test_accl_utils.cc @@ -337,8 +337,9 @@ TEST_CASE("Very basic perf test") } { func_timer<> f; - auto const &took = f.run([&map]() { map.find("ASF.com"); }); - std::cout << "std::unordered_map - insert(\"ASF.com\") took " << took << to_string::unit>::value << std::endl; + // Only time the lookup dispatch; the returned iterator is intentionally unused. + auto const &took = f.run([&map]() { static_cast(map.find("ASF.com")); }); + std::cout << "std::unordered_map - find(\"ASF.com\") took " << took << to_string::unit>::value << std::endl; } } }