Created
May 17, 2020 10:53
-
-
Save steveire/32fbf457377bc6c57bd3906cc9c8fb9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/clang-tools-extra/clang-tidy/bugprone/InaccurateEraseCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/InaccurateEraseCheck.cpp | |
index 19e91b44b41..49b0c879e72 100644 | |
--- a/clang-tools-extra/clang-tidy/bugprone/InaccurateEraseCheck.cpp | |
+++ b/clang-tools-extra/clang-tidy/bugprone/InaccurateEraseCheck.cpp | |
@@ -23,24 +23,21 @@ void InaccurateEraseCheck::registerMatchers(MatchFinder *Finder) { | |
callee(functionDecl(hasAnyName("remove", "remove_if", "unique"))), | |
hasArgument( | |
1, | |
- anyOf(cxxConstructExpr(has(ignoringImplicit( | |
+ anyOf( | |
cxxMemberCallExpr(callee(cxxMethodDecl(hasName("end")))) | |
- .bind("end")))), | |
+ .bind("end"), | |
anything()))) | |
.bind("alg"); | |
const auto DeclInStd = type(hasUnqualifiedDesugaredType( | |
tagType(hasDeclaration(decl(isInStdNamespace()))))); | |
Finder->addMatcher( | |
- traverse( | |
- ast_type_traits::TK_AsIs, | |
cxxMemberCallExpr( | |
on(anyOf(hasType(DeclInStd), hasType(pointsTo(DeclInStd)))), | |
callee(cxxMethodDecl(hasName("erase"))), argumentCountIs(1), | |
- hasArgument(0, has(ignoringImplicit(anyOf( | |
- EndCall, has(ignoringImplicit(EndCall)))))), | |
+ hasArgument(0, EndCall), | |
unless(isInTemplateInstantiation())) | |
- .bind("erase")), | |
+ .bind("erase"), | |
this); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment