[clang-tools-extra] [clang-tidy][NFC] Use universal memory mock for smart ptrs (PR #186649)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 15 01:45:13 PDT 2026


================
@@ -30,7 +14,7 @@ void Positives() {
   // CHECK-FIXES-NULLPTR: P = nullptr;
   // CHECK-FIXES-RESET: P.reset();
 
-  auto P2 = P;
+  auto &P2 = P;
----------------
vbvictor wrote:

Otherwise get error:
`Call to deleted constructor of 'std::unique_ptr<int>'clang(ovl_deleted_init)`
In real implementation:

```cpp
// Disable copy from lvalue.
      unique_ptr(const unique_ptr&) = delete;
      unique_ptr& operator=(const unique_ptr&) = delete;
```

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


More information about the cfe-commits mailing list