diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2017-05-23 23:53:17 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2017-05-23 23:53:17 +0000 |
commit | f664a24aa363ac3825a2ae50da74b2fa4a27f0bd (patch) | |
tree | 01b9a4c104780904180072a73de503123ac5dd35 /clang/lib/Sema/SemaDecl.cpp | |
parent | 7bf95b964fb7c0e3e8ae0f71c79ab3e71300e49b (diff) | |
download | bcm5719-llvm-f664a24aa363ac3825a2ae50da74b2fa4a27f0bd.tar.gz bcm5719-llvm-f664a24aa363ac3825a2ae50da74b2fa4a27f0bd.zip |
[Modules] Fix overly conservative assertion for import diagnostic
We currenltly assert when want to diagnose a missing import and the decl
in question is already visible. It turns out that the decl in question
might be visible because another decl from the same module actually made
the module visible in a previous error diagnostic.
Remove the assertion and avoid re-exporting the module if it's already
visible.
rdar://problem/27975402
Differential Revision: https://reviews.llvm.org/D32828
llvm-svn: 303705
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 5e937aa6996..11d8a756fb7 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -16097,7 +16097,8 @@ void Sema::ActOnModuleEnd(SourceLocation EomLoc, Module *Mod) { void Sema::createImplicitModuleImportForErrorRecovery(SourceLocation Loc, Module *Mod) { // Bail if we're not allowed to implicitly import a module here. - if (isSFINAEContext() || !getLangOpts().ModulesErrorRecovery) + if (isSFINAEContext() || !getLangOpts().ModulesErrorRecovery || + VisibleModules.isVisible(Mod)) return; // Create the implicit import declaration. |