================
@@ -81,7 +81,10 @@ void StringConstructorCheck::registerMatchers(MatchFinder 
*Finder) {
   Finder->addMatcher(
       cxxConstructExpr(
           hasDeclaration(cxxMethodDecl(hasName("basic_string"))),
-          argumentCountIs(2), hasArgument(0, hasType(qualType(isInteger()))),
+          anyOf(argumentCountIs(2),
+                allOf(argumentCountIs(3),
+                      hasArgument(2, unless(hasType(qualType(isInteger())))))),
----------------
localspook wrote:


I don't see an `(int, int, int)` constructor for `basic_string` 
(https://en.cppreference.com/w/cpp/string/basic_string/basic_string.html), so I 
think this `hasArgument(2, unless(hasType(qualType(isInteger()))))` part could 
be removed

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

Reply via email to