From: Argyrios Kyrtzidis Date: Sat, 29 Sep 2012 01:06:01 +0000 (+0000) Subject: Add an assertion to make sure the implicitly imported module X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb788e9b49d55bbbc661f1a9db8a54525ecdd0bc;p=clang Add an assertion to make sure the implicitly imported module is the same as the suggested one when looking up the include filename. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164872 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index ccbee631ae..5cff2fc48f 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/lib/Lex/PPDirectives.cpp @@ -1481,6 +1481,8 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc, Module *Imported = TheModuleLoader.loadModule(IncludeTok.getLocation(), Path, Visibility, /*IsIncludeDirective=*/true); + assert((Imported == 0 || Imported == SuggestedModule) && + "the imported module is different than the suggested one"); // If this header isn't part of the module we're building, we're done. if (!BuildingImportedModule && Imported)