aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SafeStack.cpp
diff options
context:
space:
mode:
authorAndrey Karlov <dein.negativ@gmail.com>2025-07-23 13:19:23 +0300
committerGitHub <noreply@github.com>2025-07-23 13:19:23 +0300
commit5de443a4d37e1b7580f9ccee389572aef7233a85 (patch)
tree0c9ac8792dee2faa7faf7773c72105db47738f55 /llvm/lib/CodeGen/SafeStack.cpp
parentffdada166689172e54bd664ff3e43c824c22c69b (diff)
downloadllvm-5de443a4d37e1b7580f9ccee389572aef7233a85.zip
llvm-5de443a4d37e1b7580f9ccee389572aef7233a85.tar.gz
llvm-5de443a4d37e1b7580f9ccee389572aef7233a85.tar.bz2
[clang-tidy] Make copy-and-swap idiom more general for `bugprone-unhandled-self-assignment` (#147066)
This change enhances the `bugprone-unhandled-self-assignment` checker by adding an additional matcher that generalizes the copy-and-swap idiom pattern detection. # What Changed Added a new matcher that checks for: - An instance of the current class being created in operator= (regardless of constructor arguments) - That instance being passed to a `swap` function call # Problem Solved This fix reduces false positives in PMR-like scenarios where "extended" constructors are used (typically taking an additional allocator argument). The checker now properly recognizes copy-and-swap implementations that use extended copy/move constructors instead of flagging them as unhandled self-assignment cases. Fixes #146324 --------- Co-authored-by: Baranov Victor <bar.victor.2002@gmail.com>
Diffstat (limited to 'llvm/lib/CodeGen/SafeStack.cpp')
0 files changed, 0 insertions, 0 deletions