[clang-tools-extra] [clang-tidy] modernize-make-shared: Add MakeSmartPtrType option (PR #117529)

via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 27 23:46:19 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 3cecf17065919da0a7fa9b38f37592e5462c2f85 4b7099bbe3d951241986b038c2492aba3c463dc3 --extensions h,cpp -- clang-tools-extra/test/clang-tidy/checkers/modernize/make-shared-ptr-name.cpp clang-tools-extra/clang-tidy/modernize/MakeSharedCheck.cpp clang-tools-extra/clang-tidy/modernize/MakeSharedCheck.h clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.h clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.cpp b/clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.cpp
index 7e57b46241..160bc3cef3 100644
--- a/clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.cpp
@@ -14,9 +14,7 @@ namespace clang::tidy::modernize {
 
 MakeUniqueCheck::MakeUniqueCheck(StringRef Name,
                                  clang::tidy::ClangTidyContext *Context)
-    : MakeSmartPtrCheck(Name, Context,
-                        "std::make_unique",
-                        "::std::unique_ptr"),
+    : MakeSmartPtrCheck(Name, Context, "std::make_unique", "::std::unique_ptr"),
       RequireCPlusPlus14(Options.get("MakeSmartPtrFunction", "").empty()) {}
 
 MakeUniqueCheck::SmartPtrTypeMatcher

``````````

</details>


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


More information about the cfe-commits mailing list