-
Notifications
You must be signed in to change notification settings - Fork 260
[BUG] UFCS doesn't work at namespace scope #314
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
@JohelEGP I think it would be good to see what cpp1 code is generated (in such issues). I will generate it by myself but it will give more context than the error message from cpp1 compiler. |
Good idea. Updated, rebased on main. |
@JohelEGP your lamda returns void. Please correct your code to: f: (x) -> _ = 0;
y := 0.f(); |
Ah, your updated code is fine. |
Thanks! Fixing in next commit... |
Incidentally, I think you win the prize for the issue that is resolved by the commit that exactly doubles the line count of cppfront from the day I first introduced it at CppCon 2022 about six months ago when it was 9 KLOC... this commit just took us over the 18 KLOC mark. (Still quite svelte! Circle is over 10x as big I think.) |
The first issue so far. ☺ I'm looking forward to the seeing the numbers when |
The `[&]` introducer is required for the UFCS lambda in case it's invoked in a deeply nested context, but then the `[&]` is illegal when it's outside a function (initializing a namespace scope object)
Describe the bug
error: non-local lambda expression cannot have a capture-default
.To Reproduce
Steps to reproduce the behavior:
Generated code
Expected result - what you expected to happen
UFCS to work at namespace scope. By using a different macro that doesn't use a capture-default.
Actual result/error
The text was updated successfully, but these errors were encountered: