summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r--clang/lib/Lex/ModuleMap.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index 14eed0ae392..d929937c016 100644
--- a/clang/lib/Lex/ModuleMap.cpp
+++ b/clang/lib/Lex/ModuleMap.cpp
@@ -220,8 +220,9 @@ static bool violatesPrivateInclude(Module *RequestingModule,
// as obtained from the lookup and as obtained from the module.
// This check is not cheap, so enable it only for debugging.
bool IsPrivate = false;
- for (auto *Hdrs : {&RequestedModule->PrivateHeaders,
- &RequestedModule->PrivateTextualHeaders})
+ auto HeaderList = {&RequestedModule->PrivateHeaders,
+ &RequestedModule->PrivateTextualHeaders};
+ for (auto *Hdrs : HeaderList)
IsPrivate |=
std::find(Hdrs->begin(), Hdrs->end(), IncFileEnt) != Hdrs->end();
assert(IsPrivate == IsPrivateRole && "inconsistent headers and roles");
OpenPOWER on IntegriCloud