Fix MSVC 2015 compilation failure around range-for without curly braces

It doesn't appear to like this pattern:
  for (auto X : Xs)
    if (...) { ... }
    else ...;

We have heard anecdotes that range based for loops are implemented as a
token rewrite in MSVC's lexer, and that the most challenging part of the
rewrite is finding the end of the for loop. That makes sense, given that
it's a lexer.

llvm-svn: 276315
This commit is contained in:
Reid Kleckner 2016-07-21 18:39:28 +00:00
parent db81b3e0b2
commit 3c944ec81a
1 changed files with 2 additions and 1 deletions

View File

@ -266,12 +266,13 @@ LinkerScript<ELFT>::createSections(OutputSectionFactory<ELFT> &Factory) {
// Add all other input sections, which are not listed in script.
for (ObjectFile &F : Symtab<ELFT>::X->getObjectFiles())
for (InputSectionBase<ELFT> *S : F->getSections())
for (InputSectionBase<ELFT> *S : F->getSections()) {
if (!isDiscarded(S)) {
if (!S->OutSec)
AddInputSec(S, getOutputSectionName(S));
} else
reportDiscarded(S, F);
}
return Result;
}