Issue 61456
Summary [C++20] [Modules] default -fmodule-output of partitions is inconsistent with -fprebuilt-module-path
Labels
Assignees
Reporter huangqinjin
    ### Example

**interface.cppm**
```cxx
export module hello:interface;
export void hello() {}
```

**hello.cppm**
```cxx
export module hello;
export import :interface;
```

**main.cpp**
```cxx
import hello;
int main() { hello(); }
```

### Problem

GCC is able to compile them in single command:
```shell
g++ -std=c++20 -fmodules-ts -x c++ interface.cppm hello.cppm main.cpp -o hello
```

But clang is **not** able to achieve by the command:
```shell
clang++ -std=c++20 -fmodule-output -fprebuilt-module-path=. interface.cppm hello.cppm main.cpp -o hello
```

### Cause
The `-fmodule-output` filename of partition `interface.cppm` is `interface.pcm` by default. (GCC & MSVC are both default to `hello-interface.gcm` / `hello-interface.ifc`). But `-fprebuilt-module-path` requires `hello-interface.pcm`.



_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to