[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:42 PDT 2024


================
@@ -54,9 +54,10 @@ makeRewriteRule(ArrayRef<StringRef> StringLikeClassNames,
           hasParameter(
               0, parmVarDecl(anyOf(hasType(StringType), hasType(CharStarType),
                                    hasType(CharType)))))),
-      on(hasType(StringType)), hasArgument(0, expr().bind("parameter_to_find")),
-      anyOf(hasArgument(1, integerLiteral(equals(0))),
-            hasArgument(1, cxxDefaultArgExpr())),
+      on(hasType(StringType)),
+      hasArgument(0, ignoringParenImpCasts(expr().bind("parameter_to_find"))),
----------------
5chmidti wrote:

Please remove the `ignoringParenImpCasts` from the `parameter_to_find` `expr`, it is not needed for this check.

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


More information about the cfe-commits mailing list