[clang] [NFC][Clang] Apply Rule of Three to BuildLockset (PR #172908)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 18 13:20:44 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Shafik Yaghmour (shafik)
<details>
<summary>Changes</summary>
Static analysis flagged BuildLockset as not following the Rule of Three, so I just added deleted copy ctor and copy assignment.
---
Full diff: https://github.com/llvm/llvm-project/pull/172908.diff
1 Files Affected:
- (modified) clang/lib/Analysis/ThreadSafety.cpp (+2)
``````````diff
diff --git a/clang/lib/Analysis/ThreadSafety.cpp b/clang/lib/Analysis/ThreadSafety.cpp
index c8d61534d0441..60d9c0f3b0ed2 100644
--- a/clang/lib/Analysis/ThreadSafety.cpp
+++ b/clang/lib/Analysis/ThreadSafety.cpp
@@ -1771,6 +1771,8 @@ class BuildLockset : public ConstStmtVisitor<BuildLockset> {
}
~BuildLockset() { Analyzer->SxBuilder.setLookupLocalVarExpr(nullptr); }
+ BuildLockset(const BuildLockset &) = delete;
+ BuildLockset &operator=(const BuildLockset &) = delete;
void VisitUnaryOperator(const UnaryOperator *UO);
void VisitBinaryOperator(const BinaryOperator *BO);
``````````
</details>
https://github.com/llvm/llvm-project/pull/172908
More information about the cfe-commits
mailing list