diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-07-05 07:47:11 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-07-05 07:47:11 +0000 |
commit | d19389a3c946e2d66be9db203c0e9e57663a89f7 (patch) | |
tree | b00559ee82d2365405ac5cc11d968ef6d83b3027 /clang/lib/AST/DeclBase.cpp | |
parent | 5b140618480195ed48128b469b277a60e990e7cc (diff) | |
download | bcm5719-llvm-d19389a3c946e2d66be9db203c0e9e57663a89f7.tar.gz bcm5719-llvm-d19389a3c946e2d66be9db203c0e9e57663a89f7.zip |
[modules ts] Improve merging of module-private declarations.
These cases occur frequently for declarations in the global module (above the
module-declaration) in a Modules TS module interface. When we merge a
definition from another module into such a module-private definition, ensure
that we transitively make everything lexically within that definition visible
to that translation unit.
llvm-svn: 307129
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 842ae9b6cc8..cd2c83a02f5 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -283,8 +283,10 @@ void Decl::setLexicalDeclContext(DeclContext *DC) { setLocalOwningModule(cast<Decl>(DC)->getOwningModule()); } - assert((!hasOwningModule() || getOwningModule() || isModulePrivate()) && - "hidden declaration has no owning module"); + assert( + (getModuleOwnershipKind() != ModuleOwnershipKind::VisibleWhenImported || + getOwningModule()) && + "hidden declaration has no owning module"); } void Decl::setDeclContextsImpl(DeclContext *SemaDC, DeclContext *LexicalDC, |