[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.

llvm-svn: 281900
This commit is contained in:
George Rimar 2016-09-19 13:27:31 +00:00
parent eb62b17d8f
commit b31dd37005
1 changed files with 2 additions and 2 deletions

View File

@ -447,8 +447,8 @@ void LinkerScript<ELFT>::assignOffsets(OutputSectionCommand *Cmd) {
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() {