From 0a42c7c6679bcc6f7be4b3d103670197acac96a9 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Tue, 24 Sep 2024 22:57:07 -0300 Subject: [clang] fix assert in ADL finding entity in the implicit global module (#109882) This adds to the assert the implicit global module case as in module purview. Fixes #109879 --- clang/lib/Sema/SemaLookup.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib/Sema/SemaLookup.cpp') diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index ed5d44a..f3f6247 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -3850,8 +3850,9 @@ void Sema::ArgumentDependentLookup(DeclarationName Name, SourceLocation Loc, // exports are only valid in module purview and outside of any // PMF (although a PMF should not even be present in a module // with an import). - assert(FM && FM->isNamedModule() && !FM->isPrivateModule() && - "bad export context"); + assert(FM && + (FM->isNamedModule() || FM->isImplicitGlobalModule()) && + !FM->isPrivateModule() && "bad export context"); // .. are attached to a named module M, do not appear in the // translation unit containing the point of the lookup.. if (D->isInAnotherModuleUnit() && -- cgit v1.1