[clang-tools-extra] [clang-tidy] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

Andrey Karlov via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 21 06:57:38 PDT 2025


================
@@ -540,6 +547,89 @@ class NotACopyAssignmentOperator {
   Uy *getUy() const { return Ptr2; }
 };
 
+// Support "extended" copy/move constructors
+class AllocatorAwareClass {
----------------
negativ wrote:

@vbvictor hey! I've added test cases for when:
- Missing call to `swap` function entirely
- There is a call to the member `swap` function but the argument type is "wrong"
- There is a call to the `ADL` `swap` function but the type of one argument is "wrong"
- There is a call to the `ADL` `swap` function but `*this` isn't passed to it

https://github.com/llvm/llvm-project/pull/147066


More information about the cfe-commits mailing list