================
@@ -0,0 +1,44 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USESHAREDPTRARRAYCHECK_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USESHAREDPTRARRAYCHECK_H
+
+#include "../ClangTidyCheck.h"
+
+namespace clang::tidy::modernize {
+
+/// Transforms pre-C++17 \c shared_ptr<T> array workarounds into
+/// \c shared_ptr<T[]>.
+///
+/// Matches:
+///   std::shared_ptr<T>(new T[N], std::default_delete<T[]>())
+///   std::shared_ptr<T>(new T[N], [](T *p) { delete[] p; })
+///
+/// Transforms to:
+///   std::shared_ptr<T[]>(new T[N])
+///
+/// For the check to activate, the TU must be compiled in C++17 or later.
----------------
zeyi2 wrote:

```
/// For the user-facing documentation see:
/// https://clang.llvm.org/extra/clang-tidy/checks/../...html
```

`add_new_check.py` would handle this automatically for you.

https://github.com/llvm/llvm-project/pull/199458
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to