[clang] 8d09311 - [clang] Sema::ActOnModuleImport - remove superfluous nullptr test

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 9 03:40:52 PST 2022


Author: Simon Pilgrim
Date: 2022-03-09T11:40:36Z
New Revision: 8d0931114f2df30c23b4eb1380185063f4684851

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

LOG: [clang] Sema::ActOnModuleImport - remove superfluous nullptr test

Mod has already been dereferenced

Added: 
    

Modified: 
    clang/lib/Sema/SemaModule.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaModule.cpp b/clang/lib/Sema/SemaModule.cpp
index d12de22241f2c..9de95e2e6087a 100644
--- a/clang/lib/Sema/SemaModule.cpp
+++ b/clang/lib/Sema/SemaModule.cpp
@@ -476,7 +476,7 @@ DeclResult Sema::ActOnModuleImport(SourceLocation StartLoc,
     Context.addModuleInitializer(ModuleScopes.back().Module, Import);
 
   // A module (partition) implementation unit shall not be exported.
-  if (getLangOpts().CPlusPlusModules && Mod && ExportLoc.isValid() &&
+  if (getLangOpts().CPlusPlusModules && ExportLoc.isValid() &&
       Mod->Kind == Module::ModuleKind::ModulePartitionImplementation) {
     Diag(ExportLoc, diag::err_export_partition_impl)
         << SourceRange(ExportLoc, Path.back().second);


        


More information about the cfe-commits mailing list