-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
C++20 modules broken in clang++17 #62071
Comments
@llvm/issue-subscribers-clang-modules |
Please be mindful of the LLVM community's code of conduct. |
Please me give an example of this not being followed. I understand that and going to its very letter. My time is valuable and I define my own time as my own, and it has been set back by attempting to experiment with clang. So, clang has wasted my time, as investment into MSVCs working C++23 prototype may be a waste due to a lack of portability. Omitting harm is not some required code of conduct from what I understand? I've used Clang for years but this 2020 draft standard is not even at experimental phase, as you cant experiment with it in Clang++17. Thats 3 years past its draft date, and by compiler history that is unusual and noteworthy. Using standard include and a templated wrapper case of it would be test #1 in 2020. Its striking that this simple example does not work. I only hope that its a compiler switch I am missing where its shaking away even when using modules: -x c++-module. My small case demonstrates the most important feature of modules and their exports seem broken, and I hadn't even begun experimenting yet. All optimizations done by Clang seem to be with the inclusion of a switch, so unless I am mistaken I don't see how I am doing this wrong. Experimenting would be including std libraries and checking performance. I can't do step 1, so I can't experiment. At multiple years into a 2020 draft thats worth saying this issue makes it so I can't form generics in any possible way with modules (the point of the language). That means I cannot experiment with C++20 with clang++17 as-is. The laboratory picture makes sense. You can't experiment in a blown up laboratory. At 3 years into expected experimental basis you simply receive these messages describing the error behavior in detail (5k+) |
I have tried using c++2b as well as c++20. that didnt help. This is the modmap file which includes both pcms when compiling main.cpp
|
This should be a duplication for #59513. |
I cannot use this compiler for experiments. What I'm noticing is you cant implement a simple lambda without having to resort to random hacks to get the compiler to not delete default constructors.
Clang version 17.0.0 (https://github.com/llvm/llvm-project f66b9fe)
Can't use GCC either because it doesnt have AArch64 on Mac. Utterly stuck, and it means write a transpiler or goto Rust (same as many others).
a.cppm
:b.cppm
:CMakeLists.txt
:main.cpp
:build log with abc2 commented out:
when its not commented, it works.
I've been waiting years for Clang to do something with C++ modules and it seems unusable. I can't EXPERIMENT with it at all. It cant DO anything. Its like a laboratory that blows up when you step foot in it. Definitely not experimental as-is.
new T(args)
is also broken, it tells you to use include new> but that doesnt fix it, as it still complains. Using::new
doesnt do it either. Its broken.As is, it seems a waste of time to proceed with Clang. Not a single experiment works for me. So I wouldnt classify this code as 'experimental', I cant experiment with it as-is! Unless I want to experiment with errors doing anything modular in nature?
The text was updated successfully, but these errors were encountered: