mirror of
https://github.com/intel/llvm.git
synced 2026-01-19 01:15:50 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user