-
Notifications
You must be signed in to change notification settings - Fork 249
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] Cannot value initialise a function argument with equivalent of C++ {}
#1090
Comments
Hi Neil, Lines 5715 to 5718 in 130f149
However that approach might not be best one given the comment right above it. I can probably add logic to the parser to grab '{}' only in this specific instance, but I'd like to hear from our BDFL, @hsutter, before going down any route. Thanks. |
Thanks! In Cpp2 so far, Hot take: |
I like that idea, I'll try it out. |
if The following doesn't work in C++ (but should)
The following should work in Cpp2:
|
Describe the bug
I can't find a Cpp2 syntax to value initialise an argument passed to a function using its default constructor.
To Reproduce
Run cppfront on this code:
(1) produces this error:
(2) produces this error:
(3) produces a cppfront syntax error.
Repro on Godbolt
Additional context
I was translating the
ranges::find_end
example from cppreference and have used explicit arguments like this:instead of the original:
The text was updated successfully, but these errors were encountered: