[llvm-branch-commits] [clang-tools-extra] [clang-tidy] `use-ranges`: avoid unsafe result fix-its (PR #196038)

Baranov Victor via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Sep 17 06:09:37 PDT 2026


================
@@ -155,7 +166,9 @@ void UseRangesCheck::registerMatchers(MatchFinder *Finder) {
                 ast_matchers::internal::DynTypedMatcher::VO_AnyOf,
                 ASTNodeKind::getFromNodeKind<CallExpr>(),
                 std::move(TotalMatchers))
-                .convertTo<CallExpr>()),
+                .convertTo<CallExpr>(),
+            anyOf(hasStructuredBindingResult(StructuredBindingResult),
+                  unless(hasStructuredBindingResult()))),
----------------
vbvictor wrote:

You can probably use `optionally(hasStructuredBindingResult(...))`

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


More information about the llvm-branch-commits mailing list