summaryrefslogtreecommitdiff
path: root/clang/test/Modules/implicit-module-with-missing-path.cpp
AgeCommit message (Collapse)Author
2024-01-12[C++20] [Modules] Remove hardcoded path to imported module in BMIsChuanqi Xu
Close https://github.com/llvm/llvm-project/issues/62707 As we discussed before, we'll forbid the use of implicit generated path for C++20 modules. And as I mentioned in https://github.com/llvm/llvm-project/issues/62707, we've emitted a warning for clang17 and we'll make it a hard error in clang18. And the patch addresses the decision.
2023-05-17[C++20] [Modules] Emit a warning if the we load the modules by implicit ↵Chuanqi Xu
generated path A step to address https://github.com/llvm/llvm-project/issues/62707. It is not user friendly enough to drop the implicitly generated path directly. Let's emit the warning first and drop it in the next version.
2022-02-11[C++20] [Modules] Check if modulemap exists to avoid crash in implicit used ↵ZezhengLi
C++ module An impilt used of C++ module without prebuild path may cause crash. For example: ``` // ./dir1/C.cppm export module C; // ./dir2/B.cppm export module B; import C; // ./A.cpp import B; import C; ``` When we compile A.cpp without the prebuild path of C.pcm, the compiler will crash. ``` clang++ -std=c++20 --precompile -c ./dir1/C.cppm -o ./dir1/C.pcm clang++ -std=c++20 --precompile -fprebuilt-module-path=./dir2 -c ./dir2/B.cppm -o ./dir2/B.pcm clang++ -std=c++20 -fprebuilt-module-path=./dir2 A.cpp ``` The prebuilt path of module C is cached when import module B, and in the function HeaderSearch::getCachedModuleFileName, the compiler try to get the filename by modulemap without check if modulemap exists, and there is no modulemap in C++ module. Reviewed By: ChuanqiXu Differential review: https://reviews.llvm.org/D119426