[clang-tools-extra] [clang-tidy] Fix redundant-parentheses diagnosing synthetic parentheses (PR #228666)

Andre Sun via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 5 20:04:41 PDT 2026


================
@@ -93,6 +93,8 @@ void RedundantParenthesesCheck::registerMatchers(MatchFinder *Finder) {
 
 void RedundantParenthesesCheck::check(const MatchFinder::MatchResult &Result) {
   const auto *PE = Result.Nodes.getNodeAs<ParenExpr>("dup");
+  if (PE->getLParen() == PE->getRParen())
+    return;
----------------
and2049 wrote:

Moved it to an `isWritten` matcher on the outer `parenExpr`

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


More information about the cfe-commits mailing list