<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64481>64481</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang-Tidy modernize-make-shared not report issue on reset
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
liuluheng
</td>
</tr>
</table>
<pre>
we have `demo.cc` as below
```
#include <memory>
// https://clang.llvm.org/extra/clang-tidy/checks/modernize/make-shared.html#modernize-make-shared
void test() {
std::shared_ptr<int> my_ptr;
my_ptr.reset(new int(1));
}
```
and then run
```
clang-tidy -checks=-*,modernize-make-shared demo.cc
```
it will not report the issue on the **reset call** as documented in the [document link](https://clang.llvm.org/extra/clang-tidy/checks/modernize/make-shared.html#modernize-make-shared)
this was tested both on the clang-tidy version 13.0.1 and 16.0.0
I spend some time on debug.
if I change as below, it will report.
```
diff --git a/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp b/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp
index 2f9f47d3f..a6b7b01b1 100644
--- a/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp
@@ -96,7 +96,7 @@ void MakeSmartPtrCheck::registerMatchers(ast_matchers::MatchFinder *Finder) {
this);
Finder->addMatcher(
- traverse(TK_AsIs,
+ traverse(TK_IgnoreUnlessSpelledInSource,
cxxMemberCallExpr(
thisPointerType(getSmartPointerTypeMatcher()),
callee(cxxMethodDecl(hasName("reset"))),
```
So is this a BUG or the demo usage issue
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8Vc1uqzgUfhpncwQCQ0hYsGiSZlSNOrpSe9eVwQfw1NiRbfozTz-ygSS9E82qupEVfHz-P9ufmbWiU4gVWe_I-rBio-u1qaQY5dij6la15p_VO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