]> git.ipfire.org Git - thirdparty/gcc.git/commit
Implement P0305R1, Selection statements with initializer.
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Oct 2016 18:02:06 +0000 (18:02 +0000)
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Oct 2016 18:02:06 +0000 (18:02 +0000)
commita9e44c436368cf441384b437a9ede510e151893b
tree226e1dc1f2ccd43d3ad167bef4ae957897611f43
parentd0a5b5950be55ce3adea3fcd16480c49fec45b4a
Implement P0305R1, Selection statements with initializer.
* cp-array-notation.c (create_an_loop): Call finish_init_stmt
instead of finish_for_init_stmt.
* cp-tree.h (finish_for_init_stmt): Rename to finish_init_stmt.
* decl.c (poplevel): Adjust a comment.
* init.c (build_vec_init): Call finish_init_stmt instead of
finish_for_init_stmt.
* name-lookup.c (pushdecl_maybe_friend_1): Adjust a comment.
* name-lookup.h (enum scope_kind): Likewise.
* parser.c (cp_parser_statement): Update commentary.
(cp_parser_init_statement_p): New function.
(cp_parser_selection_statement): Parse the optional init-statement.
(cp_parser_for): Call finish_init_stmt instead of finish_for_init_stmt.
(cp_parser_c_for): Likewise.
(cp_convert_range_for): Call finish_init_stmt instead of finish_for_init_stmt.
(cp_parser_range_for_member_function): Update commentary.
(cp_parser_iteration_statement):
(cp_parser_for_init_statement): Rename to cp_parser_init_statement.
* pt.c (tsubst_omp_for_iterator): Update commentary.
(tsubst_expr): Call finish_init_stmt instead of finish_for_init_stmt.
* semantics.c (finish_for_init_stmt): Rename to finish_init_stmt.
Update commentary.

* g++.dg/cpp1z/init-statement1.C: New test.
* g++.dg/cpp1z/init-statement2.C: New test.
* g++.dg/cpp1z/init-statement3.C: New test.
* g++.dg/cpp1z/init-statement4.C: New test.
* g++.dg/cpp1z/init-statement5.C: New test.
* g++.dg/cpp1z/init-statement6.C: New test.
* g++.dg/cpp1z/init-statement7.C: New test.
* g++.dg/cpp1z/init-statement8.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240798 138bc75d-0d04-0410-961f-82ee72b054a4
19 files changed:
gcc/cp/ChangeLog
gcc/cp/cp-array-notation.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/init.c
gcc/cp/name-lookup.c
gcc/cp/name-lookup.h
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/init-statement1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/init-statement2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/init-statement3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/init-statement4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/init-statement5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/init-statement6.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/init-statement7.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/init-statement8.C [new file with mode: 0644]