On Tue, May 29, 2018 at 10:38:09AM -0400, Jason Merrill wrote: > > int a[2] = {1, 2}; > > int D.2131[2] = a; > > int x [value-expr: D.2131[0]]; > > int y [value-expr: D.2131[1]]; > > > > <<cleanup_point int a[2] = {1, 2};>>; > > int D.2131[2] = a; > > return <retval> = x + y; > > > > is what original dump shows as implemented, so I don't see a being used here > > as an lvalue, we copy the elements into the temporary and that is all where > > it is referenced. > > Ah, no, you're right for foo, where the structured binding declaration > is not a reference. And it looks like we shouldn't hit this path for > > auto & [x,y] = a; > > but that should be added to the testcase.
It is already there (in baz). Jakub