-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
Closure object structured binding: data member names are missing #181
Comments
Hello @languagelawyer, thank you. That is once again an interesting piece of code. I gave it a look and had to scratch my head multiple times to see through it. The sad part is, currently I have no glue how to fix it. I'm willing to choose the "not fixing" card but I will think more about it. Andreas |
Here is a relevant clang bugreport https://bugs.llvm.org/show_bug.cgi?id=41765 |
Hello @languagelawyer, sorry that it took so long. I starred at this issue multiple times. Until yesterday the conclusion was always "I don't know how to fix this". Then yesterday, I revisited it from a different angle and there it is :-) I overlooked the fact, that this is the first time a lambda is decomposed. I knew it, but didn't take it into account. Lambda Thanks for reporting this interesting case! Andreas |
Fixed #181: Correctly spell the name of a decomposed closure object.
Let's look a the following code
it is transformed into
https://cppinsights.io/lnk?code=aW50IG1haW4oKQp7CglpbnQgeCA9IDEsIHkgPSAyOwoJYXV0byBmID0gWyZdKGF1dG8gc2VsZikgewoJCSh2b2lkKXg7ICh2b2lkKXk7IC8vIG1ha2UgJ2VtIHVzZWQhCgkJYXV0byYgW2EsIGJdID0gKnNlbGY7IC8vIGEgPT0gMSwgYiA9PSAyLiBEZXBlbmRzIG9uIHRoZSBwcmV2aW91cyBsaW5lLgoJCXJldHVybiBiIC0gYTsKCX07CglyZXR1cm4gZigmZik7IC8vIHJldHVybnMgMQp9&insightsOptions=&std=undefined&rev=1.0
In the lines 15 and 16:
data member names are missing. Also, I believe, the types of
a
andb
should beint&
, notint&&
:Not fixing this is also an option, because it is believed that closure object decomposition should be banned by the Standard.
The text was updated successfully, but these errors were encountered: