From: Paul Floyd Date: Wed, 10 Sep 2025 19:53:22 +0000 (+0200) Subject: Helgrind regtest: use older C++ dialect for bug392331.cpp X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba81960352892d52ec7a1efc381697a8656b12e7;p=thirdparty%2Fvalgrind.git Helgrind regtest: use older C++ dialect for bug392331.cpp Old versions of GCC (like 6.3) claim some C++17 support but apparently not CTAD https://en.cppreference.com/w/cpp/language/class_template_argument_deduction.html So, go backwards and explicitly give the std::mutex template type for the locks. --- diff --git a/helgrind/tests/bug392331.cpp b/helgrind/tests/bug392331.cpp index ff26883b7..bd6cc5a23 100644 --- a/helgrind/tests/bug392331.cpp +++ b/helgrind/tests/bug392331.cpp @@ -16,7 +16,7 @@ bool processed = false; void worker_thread() { // Wait until main() sends data - std::unique_lock lk(m); + std::unique_lock lk(m); cv.wait(lk, []{return ready;}); // after the wait, we own the lock. @@ -40,7 +40,7 @@ int main() data = "Example data"; // send data to the worker thread { - std::lock_guard lk(m); + std::lock_guard lk(m); ready = true; std::cout << "main() signals data ready for processing\n"; } @@ -48,7 +48,7 @@ int main() // wait for the worker { - std::unique_lock lk(m); + std::unique_lock lk(m); cv.wait(lk, []{return processed;}); } std::cout << "Back in main(), data = " << data << '\n';