[clang-tools-extra] [clang-tidy] Fix false positive in readability-redundant-parentheses … (PR #192827)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Apr 19 21:32:03 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE LINT COMMENT: clang-tidy-->
:warning: C/C++ code linter, clang-tidy found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
```bash
git diff -U0 origin/main...HEAD -- clang-tools-extra/clang-tidy/readability/RedundantParenthesesCheck.cpp |
python3 clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py -path build -p1 -quiet
```
</details>
<details>
<summary>
View the output from clang-tidy here.
</summary>
```
clang-tools-extra/clang-tidy/readability/RedundantParenthesesCheck.cpp:54:17: error: no matching function for call to 'subExpr' [clang-diagnostic-error]
54 | parenExpr(subExpr(anyOf(
| ^~~~~~~
clang-tools-extra/clang-tidy/readability/RedundantParenthesesCheck.cpp:24:26: note: candidate function not viable: requires single argument 'InnerMatcher', but 2 arguments were provided
24 | AST_MATCHER_P(ParenExpr, subExpr, ast_matchers::internal::Matcher<Expr>,
| ^
clang/include/clang/ASTMatchers/ASTMatchersMacros.h:131:32: note: expanded from macro 'AST_MATCHER_P'
131 | AST_MATCHER_P_OVERLOAD(Type, DefineMatcher, ParamType, Param, 0)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clang/include/clang/ASTMatchers/ASTMatchersMacros.h:151:57: note: expanded from macro 'AST_MATCHER_P_OVERLOAD'
151 | inline ::clang::ast_matchers::internal::Matcher<Type> DefineMatcher( \
| ^
152 | ParamType const &Param) { \
| ~~~~~~~~~~~~~~~~~~~~~~
clang-tools-extra/clang-tidy/readability/RedundantParenthesesCheck.cpp:64:12: error: no member named 'bind' in 'clang::ast_matchers::internal::Matcher<clang::ParenExpr>' [clang-diagnostic-error]
54 | parenExpr(subExpr(anyOf(
| ~~~~~~~~~~~~~~
55 | parenExpr(), ConstantExpr,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
56 | declRefExpr(to(namedDecl(unless(
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57 | matchers::matchesAnyListedRegexName(AllowedDecls))))),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58 | memberExpr(),
| ~~~~~~~~~~~~~
59 | callExpr(unless(cxxOperatorCallExpr(
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60 | unless(hasOverloadedOperatorName("()")))))),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61 | unless(anyOf(isInMacro(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~
62 | // sizeof(...) is common used.
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63 | hasParent(unaryExprOrTypeTraitExpr()))))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64 | .bind("dup"),
| ^
```
</details>
https://github.com/llvm/llvm-project/pull/192827
More information about the cfe-commits
mailing list