irishrover wrote:
> It seems that the `ParamExpr` may include the outer parentheses `(..)` while
> `RedundantExpr` doesn't... (IIUC `hasDescendant` traverses down into the
> expression tree)
>
> So we are essentially comparing the range of: `(std::string(s))` and
> `std::string(s)`.
>
> ```diff
> @@ -73,9 +73,10 @@ void
> StringViewConversionsCheck::registerMatchers(MatchFinder *Finder) {
> // Ignore cases where the argument is a function call
> unless(ignoringParenImpCasts(IsImplicitStringViewFromCall)),
> // Match either syntax for std::string construction
> - hasDescendant(expr(anyOf(RedundantFunctionalCast,
> - RedundantStringConstruction))
> - .bind("redundantExpr")),
> + hasDescendant(
> + expr(ignoringParens(expr(anyOf(RedundantFunctionalCast,
> +
> RedundantStringConstruction))))
> + .bind("redundantExpr")),
> ```
>
> If this is the root cause, maybe we can implement the fix in this PR? WDYT?
Unfortunately did not help.
https://github.com/llvm/llvm-project/pull/179027
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits