[clang-tools-extra] [clang-tidy] Add modernize-use-shared-ptr-array check (#180441) (PR #199458)
Zeyi Xu via cfe-commits
cfe-commits at lists.llvm.org
Mon May 25 19:25:16 PDT 2026
================
@@ -0,0 +1,81 @@
+201~200~.. title:: clang-tidy - modernize-use-shared-ptr-array
+
+modernize-use-shared-ptr-array
+==============================
+
+Finds ``std::shared_ptr<T>`` constructions that manage dynamically allocated
+arrays using explicit array deleters and suggests replacing them with
+``std::shared_ptr<T[]>``, which has been available since C++17.
+
+Fix-its are provided when the transformation can be applied safely. Some
+patterns are diagnosed without a fix-it (warn-only), and others produce
+no diagnostic at all.
+
+The check requires C++17 or later.
----------------
zeyi2 wrote:
```suggestion
The check requires C++17 or later.
```
https://github.com/llvm/llvm-project/pull/199458
More information about the cfe-commits
mailing list