-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[C++20] [Modules] Crash with inconsistent deduced type in two importing modules #78830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I could minimize the setup without Step to reproduce
// Type.ccm
export module MyVec:Type;
template <class T> struct Size {
auto total() const { return 1; }
};
// Vec.ccm
export module MyVec:Vec;
import :Type;
int size_ = Size<int>().total();
// Vec2.ccm
export module MyVec:Vec2;
import :Type;
struct Vec2 {
Size<int> size_;
};
// Calculator.ccm
export module MyVec:Calculator;
import :Vec;
import :Vec2;
auto Calculate() { return Size<int>().total(); };
$CXX -std=c++23 -c Type.ccm \
-fmodule-output=MyVec-Type.pcm
$CXX -std=c++23 -c Vec2.ccm \
-fmodule-output=MyVec-Vec2.pcm \
-fmodule-file=MyVec:Type=MyVec-Type.pcm
$CXX -std=c++23 -c Vec.ccm \
-fmodule-output=MyVec-Vec.pcm \
-fmodule-file=MyVec:Type=MyVec-Type.pcm
$CXX -std=c++23 -c Calculator.ccm \
-fmodule-output=MyVec-Calculator.pcm \
-fmodule-file=MyVec:Vec=MyVec-Vec.pcm \
-fmodule-file=MyVec:Vec2=MyVec-Vec2.pcm \
-fmodule-file=MyVec:Type=MyVec-Type.pcm Environment
Output
P.S. |
clang
Crashes under certain conditions on MacOS.Clang
Crashes on Simple Module Project in MacOS
@llvm/issue-subscribers-clang-modules Author: Gen (gen740)
I created a C++20 modules project incorporating STL libraries, ranges and OpenMP, but it suddenly crashes. I've set up a minimum reproduction project at [gen740/InternalCompilerError](https://github.com/gen740/InternalCompilerError). (I couldn't minimize the issue further!)
The error message can be found here: I also confirmed that this issue occurs in the HEAD branch. However, I can't reproduce it on Compiler Explorer at https://godbolt.org/z/h8M1sq5zc. |
Clang
Crashes on Simple Module Project in MacOS
I created a C++20 modules project incorporating STL libraries, ranges and OpenMP, but it suddenly crashes. I've set up a minimum reproduction project at gen740/InternalCompilerError. (I couldn't minimize the issue further!)
The error message can be found here:
https://github.com/gen740/InternalCompilerError/actions/runs/7592379101/job/20681666596#step:7:33
I also confirmed that this issue occurs in the HEAD branch. However, I can't reproduce it on Compiler Explorer at https://godbolt.org/z/h8M1sq5zc.
The text was updated successfully, but these errors were encountered: