From cf396c56e7df756d460a456f99ceab1b5d2c2e37 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Thu, 24 Mar 2022 13:10:38 +0000 Subject: [PATCH] [C++20][Modules] Correct an assert for modules-ts. When adding the support for modules partitions we added an assert that the actual status of Global Module Fragments matches the state machine that is driven by the module; keyword. That does not apply to the modules-ts case, where there is an implicit GMF. Differential Revision: https://reviews.llvm.org/D122394 --- clang/lib/Sema/SemaModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Sema/SemaModule.cpp b/clang/lib/Sema/SemaModule.cpp index a115834..e28de8c 100644 --- a/clang/lib/Sema/SemaModule.cpp +++ b/clang/lib/Sema/SemaModule.cpp @@ -206,7 +206,7 @@ Sema::ActOnModuleDecl(SourceLocation StartLoc, SourceLocation ModuleLoc, ModuleScopes.back().Module->Kind == Module::GlobalModuleFragment) GlobalModuleFragment = ModuleScopes.back().Module; - assert((!getLangOpts().CPlusPlusModules || + assert((!getLangOpts().CPlusPlusModules || getLangOpts().ModulesTS || SeenGMF == (bool)GlobalModuleFragment) && "mismatched global module state"); -- 2.7.4