[clang-tools-extra] 143551a - [clang-tidy][NFC] Fix error in example code for `modernize-use-scoped-lock`'s doc (#159722)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 19 01:49:31 PDT 2025
Author: flovent
Date: 2025-09-19T08:49:27Z
New Revision: 143551a42c694b0f9c0976ecfa7cb20c28274cb6
URL: https://github.com/llvm/llvm-project/commit/143551a42c694b0f9c0976ecfa7cb20c28274cb6
DIFF: https://github.com/llvm/llvm-project/commit/143551a42c694b0f9c0976ecfa7cb20c28274cb6.diff
LOG: [clang-tidy][NFC] Fix error in example code for `modernize-use-scoped-lock`'s doc (#159722)
Added:
Modified:
clang-tools-extra/docs/clang-tidy/checks/modernize/use-scoped-lock.rst
Removed:
################################################################################
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
More information about the cfe-commits
mailing list