https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120776
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #61911|0 |1 is obsolete| | --- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 61912 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61912&action=edit gcc16-pr120776-wip.patch Latest state. Still need more testcases (though admittedly something will just not work until P2686R4 is implemented fully), figure out what to do about range extension (see https://github.com/cplusplus/CWG/issues/724 for some issues), whether using ptrdiff_t(i) that the patch currently uses for iterating expansion statements is ok (see https://github.com/cplusplus/CWG/issues/725 ) and at least add a testcase for redeclarations (both something declared in init-stmt with for-range-declaration and possibly (see https://github.com/cplusplus/CWG/issues/729 ) also in the body. I think the code currently does diagnose it even in the body, but will need testcases. Also tests for tuple based structured bindings (both in destructuring expansion statements and when structured bindings are used in for-range-declaration). Also tests for what happens when it is not iterating and is not valid destructuring either.