Issue 84002
Summary [Clang][Module] Transitive importation as in [module.import]/7 is not fully implemented
Labels c++20, clang:modules
Assignees
Reporter poyaoc97
    Looks like Clang does transitive import as in [[module.import]/7](https://timsong-cpp.github.io/cppwp/n4868/module.import#7.sentence-2) only when the `U` is ["implicitly imported ([module.unit]/8)"](https://timsong-cpp.github.io/cppwp/n4868/module.unit#8).

Basically, I expect transitive import to work when dealing with module partitions. Right now, [this program](https://godbolt.org/z/dnbqooKPa) doesn't compile:

The primary module interface unit:
```c++
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)
```c++
module test;
// OK, implicitly imports the primary module interface unit,
// and transitively imports std as expected
void testMIU() { std::println("testMIU"); }
```
A partition:
```c++
export module test:part_interface;
import std;

export void testPartition();
```
Another partition:
```c++
module test:part_impl;
import :part_interface; // should transitively import std!!
// import std; // <============ should NOT be needed

void testPartition() {
  std::println("testPartition");
} 
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to