-
Notifications
You must be signed in to change notification settings - Fork 85
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
Compile error when returning values from a tl::expected with a void expected value #316
Comments
Wow, what an interesting find! I'm afraid it may take a while to understand exactly where and how things go wrong here. This is not obvious to me at all. |
I've worked around it by changing the interface to return a (slightly contrived) value in the expected case, so no worries! |
Current clang/libc++ main has support for C++23 std::expected, and using that instead works, so I'm leaning towards this being a bug in tl::expected. I'll investigate more, though. |
It also works with Martin Moene's |
Thanks! Closing this since it's looks like a bug in tl::expected. We used expected-lite a while back, but for some reason I don't remember, we replaced it with tl::expected. Might be worth reconsidering again. |
Environment (from conan):
I have a problem with mocking
tl::expected
return values, which has a void expected value (i.e., for a case where only the error value is interesting). I can't figure out how to write theREQUIRE_CALL
for the expected value, which in real code would just do areturn {}
.Example below. I've tried various other variants, but not found a working solution.
The error, after a long list of other complaints, boils down to
The text was updated successfully, but these errors were encountered: