File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed
Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -888,7 +888,7 @@ class VisibleModuleSet {
888888
889889 // / Get the location at which the import of a module was triggered.
890890 SourceLocation getImportLoc (const Module *M) const {
891- return M->getVisibilityID () < ImportLocs.size ()
891+ return M && M ->getVisibilityID () < ImportLocs.size ()
892892 ? ImportLocs[M->getVisibilityID ()]
893893 : SourceLocation ();
894894 }
Original file line number Diff line number Diff line change 1+ // RUN: split-file %s %t
2+
3+ // There are two requirements here to result in the owner of a macro being null.
4+ // 1) There must be a configuration mismatch between a header and a file it depends on
5+ // 2) -fmodules-local-submodule-visibility must be enabled.
6+
7+ // Unfortunately, libcxx is compiled with exceptions, but the sysroot it depends on is likely compiled without exceptions.
8+
9+ // RUN: %clang_cc1 -I%t -emit-module -o %t/a.pcm -fmodules %t/module.modulemap -fmodule-name=a -fmodules-local-submodule-visibility
10+ // RUN: %clang_cc1 -fexceptions -Wno-module-file-config-mismatch -I%t -emit-module -o %t/b.pcm -fmodules %t/module.modulemap -fmodule-name=b -fmodules-local-submodule-visibility -fmodule-file=%t/a.pcm
11+ // RUN: %clang_cc1 -fexceptions -Wno-module-file-config-mismatch -I%t -emit-module -o %t/c.pcm -fmodules %t/module.modulemap -fmodule-name=c -fmodules-local-submodule-visibility -fmodule-file=%t/a.pcm -fmodule-file=%t/b.pcm
12+
13+ // --- module.modulemap
14+ module a { header " a.h" }
15+ module b { header " b.h" }
16+ module c { header " c.h" }
17+
18+ // --- a.h
19+ #ifndef A_H
20+ #define A_H
21+ #endif
22+
23+ // --- b.h
24+ #ifndef B_H
25+ #define B_H
26+
27+ #include < a.h>
28+
29+ #endif
30+
31+ // --- c.h
32+ #include < a.h>
33+ #include < b.h>
You can’t perform that action at this time.
0 commit comments