llvm-project/clang/test/Modules/no-undeclared-includes.c
Ian Anderson 09ec0004ee
[Modules] textual headers in submodules never resolve their uses (#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.
2023-10-20 13:23:34 -07:00

32 lines
533 B
C

// 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 *
}