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.
This commit is contained in:
Dana Jansens
2026-09-11 17:04:40 +00:00
committed by GitHub
parent c45efd625f
commit 111ec69b65
+4 -4
View File
@@ -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<void>(
((ok && (ok = (std::get<Index>(fields) = Extractable<U>::Extract(*this))
.has_value()),
unused) = ... = 0));
// NOLINTNEXTLINE(bugprone-assignment-in-selection-statement)
((ok && (ok = (std::get<Index>(fields) = Extractable<U>::Extract(*this))
.has_value()),
unused) = ... = 0);
if (!ok) {
MaybeTrace("Aggregate {0}: error\n", llvm::getTypeName<T>());
return std::nullopt;