[clang-tools-extra] [clang-tidy] Add bugprone-smart-ptr-initialization check (PR #181570)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 14 13:22:36 PDT 2026


================
@@ -0,0 +1,106 @@
+# clang-tidy - bugprone-smart-ptr-initialization
+
+## bugprone-smart-ptr-initialization
+
+Detects dangerous initialization of smart pointers with raw pointers that are
+already owned elsewhere, which can lead to double deletion.
+
+This check implements CERT C++ rule [MEM56-CPP. Do not store an already-owned
----------------
vbvictor wrote:

We have references ad the end, no need to double-write here

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


More information about the cfe-commits mailing list