From 89484972836d37f9bd66d61dbdce8a0eb2f3d548 Mon Sep 17 00:00:00 2001 From: flovent Date: Fri, 19 Sep 2025 16:37:59 +0800 Subject: [PATCH] [clang-tidy][NFC] Fix error in example code for `modernize-use-scoped-lock`'s doc --- .../docs/clang-tidy/checks/modernize/use-scoped-lock.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-scoped-lock.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-scoped-lock.rst index d184f1aefd806..7cf24b43d2e7b 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-scoped-lock.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-scoped-lock.rst @@ -51,8 +51,8 @@ Multiple ``std::lock_guard`` declarations only emit warnings: std::mutex M1, M2; std::lock(M1, M2); - std::lock_guard Lock1(M, std::adopt_lock); // warning: use single 'std::scoped_lock' instead of multiple 'std::lock_guard' - std::lock_guard Lock2(M, std::adopt_lock); // note: additional 'std::lock_guard' declared here + std::lock_guard Lock1(M1, std::adopt_lock); // warning: use single 'std::scoped_lock' instead of multiple 'std::lock_guard' + std::lock_guard Lock2(M2, std::adopt_lock); // note: additional 'std::lock_guard' declared here Limitations