]> granicus.if.org Git - clang/commitdiff
Add an assertion to make sure the implicitly imported module
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 29 Sep 2012 01:06:01 +0000 (01:06 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 29 Sep 2012 01:06:01 +0000 (01:06 +0000)
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

lib/Lex/PPDirectives.cpp

index ccbee631ae2209b58d6994c2b17844e0c615a115..5cff2fc48f392f6e684c0e92a6d18dc4e226036d 100644 (file)
@@ -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)