[lld] r281900 - [ELF] - LinkerScript: Add workaround for gcc 6.2.0 failure w/auto

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 19 06:27:32 PDT 2016


Author: grimar
Date: Mon Sep 19 08:27:31 2016
New Revision: 281900

URL: http://llvm.org/viewvc/llvm-project?rev=281900&view=rev
Log:
[ELF] - LinkerScript: Add workaround for gcc 6.2.0 failure w/auto

Will Dietz found and reported that lld does not compile with gcc 6.2.0,
more details https://llvm.org/bugs/show_bug.cgi?id=30438

And confirmed this change fixes the issue.

Modified:
    lld/trunk/ELF/LinkerScript.cpp

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=281900&r1=281899&r2=281900&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Mon Sep 19 08:27:31 2016
@@ -447,8 +447,8 @@ void LinkerScript<ELFT>::assignOffsets(O
     switchTo(Base);
     Dot += CurOutSec->getSize();
   }
-  for (auto I = E, E = Cmd->Commands.end(); I != E; ++I)
-    process(**I);
+  std::for_each(E, Cmd->Commands.end(),
+                [this](std::unique_ptr<BaseCommand> &B) { process(*B.get()); });
 }
 
 template <class ELFT> void LinkerScript<ELFT>::assignAddresses() {




More information about the llvm-commits mailing list