File tree Expand file tree Collapse file tree 2 files changed +47
-2
lines changed Expand file tree Collapse file tree 2 files changed +47
-2
lines changed Original file line number Diff line number Diff line change @@ -4473,8 +4473,7 @@ class ASTDeclContextNameLookupTrait
44734473 // parent of parent. We DON'T remove the enum constant from its parent. So
44744474 // we don't need to care about merging problems here.
44754475 if (auto *ECD = dyn_cast<EnumConstantDecl>(D);
4476- ECD && DC.isFileContext () && ECD->getOwningModule () &&
4477- ECD->getTopLevelOwningNamedModule ()->isNamedModule ()) {
4476+ ECD && DC.isFileContext () && ECD->getTopLevelOwningNamedModule ()) {
44784477 if (llvm::all_of (
44794478 DC.noload_lookup (
44804479 cast<EnumDecl>(ECD->getDeclContext ())->getDeclName ()),
Original file line number Diff line number Diff line change 1+ // Fixes #165445
2+
3+ // RUN: rm -rf %t
4+ // RUN: mkdir -p %t
5+ // RUN: split-file %s %t
6+ //
7+ // RUN: %clang_cc1 -std=c++20 -x c++-user-header %t/header.h \
8+ // RUN: -emit-header-unit -o %t/header.pcm
9+ //
10+ // RUN: %clang_cc1 -std=c++20 %t/A.cppm -fmodule-file=%t/header.pcm \
11+ // RUN: -emit-module-interface -o %t/A.pcm
12+ //
13+ // RUN: %clang_cc1 -std=c++20 %t/B.cppm -fmodule-file=%t/header.pcm \
14+ // RUN: -emit-module-interface -o %t/B.pcm
15+ //
16+ // RUN: %clang_cc1 -std=c++20 %t/use.cpp \
17+ // RUN: -fmodule-file=A=%t/A.pcm -fmodule-file=B=%t/B.pcm \
18+ // RUN: -fmodule-file=%t/header.pcm \
19+ // RUN: -verify -fsyntax-only
20+
21+ // --- enum.h
22+ enum E { Value };
23+
24+ // --- header.h
25+ #include " enum.h"
26+
27+ // --- A.cppm
28+ module ;
29+ #include " enum.h"
30+ export module A;
31+
32+ auto e = Value;
33+
34+ // --- B.cppm
35+ export module B;
36+ import " header.h" ;
37+
38+ auto e = Value;
39+
40+ // --- use.cpp
41+ // expected-no-diagnostics
42+ import A;
43+ import B;
44+ #include " enum.h"
45+
46+ auto e = Value;
You can’t perform that action at this time.
0 commit comments