Skip to content

[C++20] [Modules] Don't generate paths implicitly in BMI to their dependent BMI #62707

Closed
@ChuanqiXu9

Description

@ChuanqiXu9

See https://discourse.llvm.org/t/c-20-modules-should-the-bmis-contain-paths-to-their-dependent-bmis/70422 for detail.

Simply, after the issue resolved, the last step of the following example won't compile any more:

// b.cppm
export module b;
export int b() {
    return 43;
}

// a.cppm
export module a;
import b;
export int a() {
    return b() + 43;
}

// user.cpp
import a;
int use() {
    return a();
}
clang++ -std=c++20 b.cppm --precompile -o b.pcm
clang++ -std=c++20 a.cppm --precompile -fmodule-file=b=b.pcm -o a.pcm
clang++ -std=c++20 user.cpp -fmodule-file=a=a.pcm -c -o user.o

We need to specify all the dependency explicitly:

clang++ -std=c++20 user.cpp -fmodule-file=a=a.pcm -fmodule-file=b=b.pcm  -c -o user.o

This should be a breaking change.

Metadata

Metadata

Assignees

Labels

clang: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