Skip to content

[Clang][Module] Transitive importation as in [module.import]/7 is not fully implemented #84002

@poyaoc97

Description

@poyaoc97

Looks like Clang does transitive import as in [module.import]/7 only when the U is "implicitly imported ([module.unit]/8)".

Basically, I expect transitive import to work when dealing with module partitions. Right now, this program doesn't compile:

The primary module interface unit:

export module test;
import std;
export import :part_interface;
import :part_impl;

export void testMIU();

Module impl unit (the non-importable/not-a-partition one)

module test;
// OK, implicitly imports the primary module interface unit,
// and transitively imports std as expected
void testMIU() { std::println("testMIU"); }

A partition:

export module test:part_interface;
import std;

export void testPartition();

Another partition:

module test:part_impl;
import :part_interface; // should transitively import std!!
// import std; // <============ should NOT be needed

void testPartition() {
  std::println("testPartition");
} 

Metadata

Metadata

Assignees

Labels

c++20clang:modulesC++20 modules and Clang Header Modules

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions