[clang] cf396c5 - [C++20][Modules] Correct an assert for modules-ts.

Iain Sandoe via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 25 07:55:25 PDT 2022


Author: Iain Sandoe
Date: 2022-03-25T14:55:13Z
New Revision: cf396c56e7df756d460a456f99ceab1b5d2c2e37

URL: https://github.com/llvm/llvm-project/commit/cf396c56e7df756d460a456f99ceab1b5d2c2e37
DIFF: https://github.com/llvm/llvm-project/commit/cf396c56e7df756d460a456f99ceab1b5d2c2e37.diff

LOG: [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

Added: 
    

Modified: 
    clang/lib/Sema/SemaModule.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaModule.cpp b/clang/lib/Sema/SemaModule.cpp
index a115834d334c4..e28de8c79b273 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");
 


        


More information about the cfe-commits mailing list