From: Richard Smith Date: Fri, 14 Oct 2016 02:35:11 +0000 (+0000) Subject: Fix bogus assert breaking modules self-host. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96cad34618168320252c13f981ce64b8e6e2e720;p=clang Fix bogus assert breaking modules self-host. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284187 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index e1be7492c8..709de4368d 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -907,11 +907,13 @@ void ASTContext::mergeDefinitionIntoModulesOf(NamedDecl *Def, assert(Other->isFromASTFile() && "merge of non-imported decl not supported"); assert(Def != Other && "merging definition into itself"); - if (!getLangOpts().ModulesLocalVisibility && !Other->isHidden()) + if (!Other->isHidden()) { Def->setHidden(false); - else - assert(Other->getImportedOwningModule() && - "hidden, imported declaration has no owning module"); + return; + } + + assert(Other->getImportedOwningModule() && + "hidden, imported declaration has no owning module"); // Mark Def as the canonical definition of merged definition Other. {