[flang-commits] [PATCH] D124682: [flang] Fix build bot problem

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Apr 29 09:31:35 PDT 2022


klausler created this revision.
klausler added reviewers: jeanPerier, schweitz.
klausler added a project: Flang.
Herald added subscribers: mehdi_amini, jdoerfert.
Herald added a project: All.
klausler requested review of this revision.

A recent change is eliciting a valid warning from the out-of-tree
flang build bot; fix by using a reference in a range-based for().


https://reviews.llvm.org/D124682

Files:
  flang/lib/Lower/ConvertVariable.cpp


Index: flang/lib/Lower/ConvertVariable.cpp
===================================================================
--- flang/lib/Lower/ConvertVariable.cpp
+++ flang/lib/Lower/ConvertVariable.cpp
@@ -1004,7 +1004,7 @@
   std::vector<std::tuple<fir::GlobalOp, Fortran::semantics::MutableSymbolVector,
                          mlir::Location>>
       delayedInitializations;
-  for (const auto [common, size] : commonBlocks)
+  for (const auto &[common, size] : commonBlocks)
     if (auto delayedInit = declareCommonBlock(converter, common, size))
       delayedInitializations.emplace_back(std::move(*delayedInit));
   for (auto &[global, cmnBlkMems, loc] : delayedInitializations)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124682.426092.patch
Type: text/x-patch
Size: 678 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220429/9279880d/attachment.bin>


More information about the flang-commits mailing list