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

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


================
@@ -46,20 +46,20 @@ void SlicingCheck::registerMatchers(MatchFinder *Finder) {
           isBaseInitializer(), withInitializer(equalsBoundNode("Call"))))));
 
   // Assignment slicing: "a = b;" and "a = std::move(b);" variants.
-  const auto SlicesObjectInAssignment =
-      callExpr(expr().bind("Call"),
-               callee(cxxMethodDecl(anyOf(isCopyAssignmentOperator(),
-                                          isMoveAssignmentOperator()),
-                                    OfBaseClass)),
-               hasArgument(1, HasTypeDerivedFromBaseDecl));
+  const auto SlicesObjectInAssignment = callExpr(
+      expr().bind("Call"),
+      callee(cxxMethodDecl(
+          anyOf(isCopyAssignmentOperator(), isMoveAssignmentOperator()),
+          OfBaseClass)),
+      hasArgument(1, ignoringParenImpCasts(HasTypeDerivedFromBaseDecl)));
----------------
5chmidti wrote:

The `ignoringParenImpCasts` is not needed for the types we match.

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


More information about the llvm-commits mailing list