On Wed, May 23, 2018 at 10:45:43AM -0400, Marek Polacek wrote: > 2018-05-23 Marek Polacek <pola...@redhat.com> > > Implement P0614R1, Range-based for statements with initializer. > * parser.c (cp_parser_range_based_for_with_init_p): New. > (cp_parser_init_statement): Use it. Parse the optional init-statement > for a range-based for loop. > (cp_parser_skip_to_closing_parenthesis_1): Handle balancing ?:. > > * g++.dg/cpp2a/range-for1.C: New test. > * g++.dg/cpp2a/range-for2.C: New test. > * g++.dg/cpp2a/range-for3.C: New test. > * g++.dg/cpp2a/range-for4.C: New test. > * g++.dg/cpp2a/range-for5.C: New test. > * g++.dg/cpp2a/range-for6.C: New test. > * g++.dg/cpp2a/range-for7.C: New test.
Could you please add some testcases that would test the handling of structured bindings in these new forms of range for, like: for (int i = 0; auto [ x, y ] : z) but perhaps for completeness also in the init-stmt and perhaps both spots too? Jakub