Skip to content
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

[expr.prim.lambda.capture] p6 The specified behavior of an init-capture is incorrect #4927

Open
xmh0511 opened this issue Sep 23, 2021 · 0 comments

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Sep 23, 2021

An init-capture inhabits the scope of the lambda-expression's compound-statement. An init-capture without ellipsis behaves as if it declares and explicitly captures a variable of the form “auto init-capture ;”, except that:

  • [...]

Assume we have an init-capture x = x, the behavior would be as if it looks like

auto x = x;

According to [basic.scope.pdecl] p1 and [dcl.spec.auto.general] p11, the specified behavior is ill-formed.

@xmh0511 xmh0511 changed the title [expr.prim.lambda.capture] p6 The specified behavior of a init-capture is incorrect [expr.prim.lambda.capture] p6 The specified behavior of an init-capture is incorrect Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant