Implement P0614R1, Range-based for statements with initializer.
authorMarek Polacek <polacek@redhat.com>
Wed, 23 May 2018 16:39:47 +0000 (16:39 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 23 May 2018 16:39:47 +0000 (16:39 +0000)
commit3d76db63cdfd258ace95d12eaaf95db88bc1fa6e
treedca6330e387f24ac7e98291195b8a4e4e35fe999
parentd2ff35c0913539a31782fbc05bb6d4c2ce74f2ce
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.

From-SVN: r260619
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp2a/range-for1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/range-for2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/range-for3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/range-for4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/range-for5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/range-for6.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/range-for7.C [new file with mode: 0644]