forked from Kotlin/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Modules] textual headers in submodules never resolve their
use
s (l…
…lvm#69651) When an include from a textual header is resolved, the textual header's submodule is used as the requesting module. The submodule's uses are resolved, but that doesn't work because only top level modules have uses, and only the top level module uses are used for checking uses in Module::directlyUses. ModuleMap::resolveUses to resolve the top level module instead of the submodule.
- Loading branch information
1 parent
7fbe3cf
commit 5ee0387
Showing
2 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// RUN: rm -rf %t | ||
// RUN: split-file %s %t | ||
// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %t %t/no-undeclared-includes.c -verify | ||
|
||
//--- no-undeclared-includes.c | ||
// expected-no-diagnostics | ||
#include <assert.h> | ||
|
||
//--- assert.h | ||
#include <base.h> | ||
|
||
//--- base.h | ||
#ifndef base_h | ||
#define base_h | ||
|
||
|
||
|
||
#endif /* base_h */ | ||
|
||
//--- module.modulemap | ||
module cstd [system] [no_undeclared_includes] { | ||
use base | ||
module assert { | ||
textual header "assert.h" | ||
} | ||
} | ||
|
||
module base [system] { | ||
header "base.h" | ||
export * | ||
} |