[clang][modules] Fix crash in enum visibility lookup for C++20 header… · llvm/llvm-project@2fde0df (original) (raw)

Original file line number Diff line number Diff line change
@@ -4340,8 +4340,7 @@ class ASTDeclContextNameLookupTrait
4340 4340 // parent of parent. We DON'T remove the enum constant from its parent. So
4341 4341 // we don't need to care about merging problems here.
4342 4342 if (auto *ECD = dyn_cast(D);
4343 - ECD && DC.isFileContext() && ECD->getOwningModule() &&
4344 - ECD->getTopLevelOwningNamedModule()->isNamedModule()) {
4343 + ECD && DC.isFileContext() && ECD->getTopLevelOwningNamedModule()) {
4345 4344 if (llvm::all_of(
4346 4345 DC.noload_lookup(
4347 4346 cast(ECD->getDeclContext())->getDeclName()),