Improve modernize-make-unique matcher.
Summary: "std::unique_ptr<int>" is not the same type as "std::unique_ptr<int, std::default_delete<int>>", unless we insert a "hasCanonicalType" in the middle. Probably it also happens in other cases related to default template argument.
Reviewers: klimek
Subscribers: alexfh, cfe-commits
Differential Revision: http://reviews.llvm.org/D14291
llvm-svn: 252041
diff --git a/clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.cpp b/clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.cpp
index b7c630c..a585fe3 100644
--- a/clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/MakeUniqueCheck.cpp
@@ -42,9 +42,10 @@
qualType(equalsBoundNode(
PointerType))))))))))))))),
argumentCountIs(1),
- hasArgument(0, cxxNewExpr(hasType(pointsTo(qualType(
- equalsBoundNode(PointerType)))))
- .bind(NewExpression)))
+ hasArgument(
+ 0, cxxNewExpr(hasType(pointsTo(qualType(hasCanonicalType(
+ equalsBoundNode(PointerType))))))
+ .bind(NewExpression)))
.bind(ConstructorCall))),
this);
}