diff options
author | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2022-10-08 16:38:19 +0800 |
---|---|---|
committer | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2022-10-08 16:44:51 +0800 |
commit | 9974ed804995d2e34be69404e9904c7e03cfbda4 (patch) | |
tree | 743108d7d75d590515529d3bd124f21d668130a6 /clang/lib/Sema/SemaModule.cpp | |
parent | 566c277c64f8f76d8911aa5fd931903a357ed7be (diff) | |
download | llvm-9974ed804995d2e34be69404e9904c7e03cfbda4.zip llvm-9974ed804995d2e34be69404e9904c7e03cfbda4.tar.gz llvm-9974ed804995d2e34be69404e9904c7e03cfbda4.tar.bz2 |
[C++20] [Modules] Remove assertion of current module when acting on import
Closes https://github.com/llvm/llvm-project/issues/58199
Previously, when we act on a import statement, we'll assume there is a
module declaration in the current TU if the command line tells us we're
compiling a module unit. This makes since on valid codes. However, for
invalid codes, it is possible. See
https://github.com/llvm/llvm-project/issues/58199 for example.
This patch removes the assertion. And the assertion is a noop and it
should be safe to remove it.
Diffstat (limited to 'clang/lib/Sema/SemaModule.cpp')
-rw-r--r-- | clang/lib/Sema/SemaModule.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaModule.cpp b/clang/lib/Sema/SemaModule.cpp index b205fd9..4b01f10 100644 --- a/clang/lib/Sema/SemaModule.cpp +++ b/clang/lib/Sema/SemaModule.cpp @@ -561,11 +561,6 @@ DeclResult Sema::ActOnModuleImport(SourceLocation StartLoc, Diag(ExportLoc, diag::err_export_not_in_module_interface) << (!ModuleScopes.empty() && !ModuleScopes.back().ImplicitGlobalModuleFragment); - } else if (getLangOpts().isCompilingModule()) { - Module *ThisModule = PP.getHeaderSearchInfo().lookupModule( - getLangOpts().CurrentModule, ExportLoc, false, false); - (void)ThisModule; - assert(ThisModule && "was expecting a module if building one"); } // In some cases we need to know if an entity was present in a directly- |