[clang-tools-extra] [clang-tidy] `use-ranges`: preserve used `unique` results (PR #196035)

Julian Schmidt via cfe-commits cfe-commits at lists.llvm.org
Sun May 10 03:30:04 PDT 2026


================
@@ -191,6 +192,33 @@ static void removeFunctionArgs(DiagnosticBuilder &Diag, const CallExpr &Call,
   }
 }
 
+static bool isResultUsed(const DynTypedNode &Node,
+                         const ast_matchers::MatchFinder::MatchResult &Result) {
+  const DynTypedNodeList Parents = Result.Context->getParents(Node);
+  if (Parents.size() != 1)
+    return true;
----------------
5chmidti wrote:

What code is detected with this?

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


More information about the cfe-commits mailing list