r284187 - Fix bogus assert breaking modules self-host.
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 13 19:35:12 PDT 2016
Author: rsmith
Date: Thu Oct 13 21:35:11 2016
New Revision: 284187
URL: http://llvm.org/viewvc/llvm-project?rev=284187&view=rev
Log:
Fix bogus assert breaking modules self-host.
Modified:
cfe/trunk/lib/AST/ASTContext.cpp
Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=284187&r1=284186&r2=284187&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Thu Oct 13 21:35:11 2016
@@ -907,11 +907,13 @@ void ASTContext::mergeDefinitionIntoModu
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.
{
More information about the cfe-commits
mailing list