| Issue |
173689
|
| Summary |
[C++20][Modules] `-fmodule-output` does not work as documented
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
cpplearner
|
[StandardCPlusPlusModules](https://github.com/llvm/llvm-project/blob/571819cb7931f071c09b4129d8ec130ef63fe8dd/clang/docs/StandardCPlusPlusModules.rst) says:
> The `-fmodule-output` option generates the BMI as a by-product of the compilation. Otherwise, the BMI will be emitted in the working directory with the name of the input file with the extension `.pcm`.
However, empirically, clang does not generate the `.pcm` file in the working directory (the directory where I invoke `clang++`), but generates it in the directory of the source file.
For example, if `test.cppm` is located in `D:\test\src\modules`, the working directory is `D:\test\build`, and I run `clang++ -fmodule-output D:\test\src\modules\test.cppm -std=c++20`, then I find `test.pcm` in `D:\test\src\modules`.
Both the review comment in https://reviews.llvm.org/D137058#3992214 and the commit message of https://github.com/llvm/llvm-project/commit/f89327e28bc17a1d80fd5523520e62d8dd53c1cb seem to indicate that the intended behavior is to generate the file in the working directory, but the production code as well as the testcase says otherwise.
I believe that clang's current behavior is incorrect, and what's documented is the correct behavior.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs