Skip to content

Commit 9099d69

Browse files
[Vectorize] Fix a warning
This patch fixes: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:2699:49: error: captured structured bindings are a C++20 extension [-Werror,-Wc++20-extensions]
1 parent 337936a commit 9099d69

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2691,7 +2691,11 @@ static void addFullyUnrolledInstructionsToIgnore(
26912691
auto *Cmp = L->getLatchCmpInst();
26922692
if (Cmp)
26932693
InstsToIgnore.insert(Cmp);
2694-
for (const auto &[IV, IndDesc] : IL) {
2694+
for (const auto &KV : IL) {
2695+
// Extract the key by hand so that it can be used in the lambda below. Note
2696+
// that captured structured bindings are a C++20 extension.
2697+
const PHINode *IV = KV.first;
2698+
26952699
// Get next iteration value of the induction variable.
26962700
Instruction *IVInst =
26972701
cast<Instruction>(IV->getIncomingValueForBlock(L->getLoopLatch()));

0 commit comments

Comments
 (0)