-
Notifications
You must be signed in to change notification settings - Fork 258
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
[BUG] No direct UFCS syntax for (captured function object, dependent base member, function object prvalue) #748
Comments
From #741 (comment):
|
Also, can't do UFCS on a dependent base member (#741 (comment)):
|
For now, I can workaround this with |
Function object prvalue I forgot to mention this other case where you first need to construct a callable. Consider the call in the Let's rewrite it in UFCS order: The |
Title: Can't capture function object for UFCS.
Description:
As an exercise, I tried implementing the CL combinators from Function Composition in Programming Languages - Conor Hoekstra - CppNorth 2023.
Implementations
https://cpp2.godbolt.org/z/WjTTnf383:



At first, I tried using UFCS.
That doesn't work because the capture is the postfix-expression before the
$
.That includes the object argument.
But I just wanted the function object.
Minimal reproducer (https://cpp2.godbolt.org/z/cYcb4c5YW):
Commands:
cppfront main.cpp2 clang++18 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -I . main.cpp
Expected result: Same as not using UFCS.
Actual result and error:
Cpp2 lowered to Cpp1:
Output:
The text was updated successfully, but these errors were encountered: