[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

Julian Schmidt via cfe-commits cfe-commits at lists.llvm.org
Wed May 1 12:23:45 PDT 2024


================
@@ -97,11 +97,12 @@ AST_MATCHER_FUNCTION_P(StatementMatcher, isConstRefReturningMethodCall,
       hasCanonicalType(recordType(hasDeclaration(namedDecl(
           unless(matchers::matchesAnyListedName(ExcludedContainerTypes))))));
 
-  return expr(
-      anyOf(cxxMemberCallExpr(callee(MethodDecl), on(OnExpr),
-                              thisPointerType(ReceiverType)),
-            cxxOperatorCallExpr(callee(MethodDecl), hasArgument(0, OnExpr),
-                                hasArgument(0, hasType(ReceiverType)))));
+  return expr(anyOf(
+      cxxMemberCallExpr(callee(MethodDecl), on(OnExpr),
+                        thisPointerType(ReceiverType)),
+      cxxOperatorCallExpr(
+          callee(MethodDecl), hasArgument(0, ignoringParenImpCasts(OnExpr)),
+          hasArgument(0, ignoringParenImpCasts(hasType(ReceiverType))))));
----------------
5chmidti wrote:

This `ignoringParenImpCasts` shouldn't be needed

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


More information about the cfe-commits mailing list