From 111ec69b65084e57f7de60551cdb31daa20fd8d8 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 11 Sep 2026 17:04:40 +0000 Subject: [PATCH] NOLINT an assignment in a complex boolean statement (#7775) We use a complex fold statement over `operator=`, with an assignment to a variable earlier in the folded-over expression, which is intentional. --- toolchain/parse/extract.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolchain/parse/extract.h b/toolchain/parse/extract.h index 821b3e1ce8c5..f7daa9035481 100644 --- a/toolchain/parse/extract.h +++ b/toolchain/parse/extract.h @@ -273,10 +273,10 @@ auto NodeExtractor::ExtractTupleLikeType( // Use a fold over the `=` operator to parse fields from right to left. [[maybe_unused]] int unused; bool ok = true; - static_cast( - ((ok && (ok = (std::get(fields) = Extractable::Extract(*this)) - .has_value()), - unused) = ... = 0)); + // NOLINTNEXTLINE(bugprone-assignment-in-selection-statement) + ((ok && (ok = (std::get(fields) = Extractable::Extract(*this)) + .has_value()), + unused) = ... = 0); if (!ok) { MaybeTrace("Aggregate {0}: error\n", llvm::getTypeName()); return std::nullopt;