-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
std::expected
and related types are not implemented.
#62801
Comments
Works just fine for me: https://godbolt.org/z/YPs13zYT3. What system are you on? Which compiler and library version are you using? What is the actual code you are trying to run? |
The distro is Debian The test program is #include <expected>
int main(){
using T = std::expected<int, char>;
return 0;
} packages:
Compilation with clang++ -v -std=gnu++2b ./test_std_expected.cpp (if I add
Compilation with g++ -v -std=gnu++2b ./test_std_expected.cpp
(compiled succesfully) |
The problem seems to be with
If we #if __cpp_concepts < 202002L
#error "No concepts"
#endif Then the condition triggers. clang++ -std=gnu++2b -D__cpp_concepts=202002L ./test_std_expected.cpp compiles. |
Yeah OK. That's a deliberate choice on the Clang side of things to not advertise concepts as completed and libstdc++ to require concepts. I think you either have to wait until clang claims full support for concepts or switch to libc++. |
As I have written,
Currently I just use polyfills (https://github.com/TartanLlama/expected, https://github.com/martinmoene/expected-lite, https://github.com/RishabhRD/expected, the first one has CPack packaging implemented, so I use it). |
Does clang maybe use an old version of libc++? It should be implemented and available with libc++. |
Now I have installed both |
clang++ -std=gnu++2b ./test.cpp
error: no template named 'expected' in namespace 'std'
The text was updated successfully, but these errors were encountered: