Fix bogus assert breaking modules self-host.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 14 Oct 2016 02:35:11 +0000 (02:35 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 14 Oct 2016 02:35:11 +0000 (02:35 +0000)
llvm-svn: 284187

clang/lib/AST/ASTContext.cpp

index e1be749..709de43 100644 (file)
@@ -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.
   {