Handle C++14 constexpr flow control.
authorJason Merrill <jason@redhat.com>
Mon, 17 Nov 2014 19:08:07 +0000 (14:08 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 17 Nov 2014 19:08:07 +0000 (14:08 -0500)
commit56632b2773bfc2ebe722fa21c796c7369acf9a9c
tree73dc149a26c6bd49aa72590cac53a322919a5295
parent27d93d2c8a36cea495599e4eb070d3f922aab279
Handle C++14 constexpr flow control.

* constexpr.c (cxx_eval_loop_expr, cxx_eval_switch_expr): New.
(cxx_eval_statement_list): New.
(cxx_eval_constant_expression): Handle LABEL_EXPR,
CASE_LABEL_EXPR, GOTO_EXPR, LOOP_EXPR, SWITCH_EXPR.  Handle jump
semantics of RETURN_EXPR.
(many functions): Add jump_target parameter.
(returns, breaks, continues, switches, label_matches): New.
* cp-tree.h (LABEL_DECL_BREAK, LABEL_DECL_CONTINUE): New.
* cp-gimplify.c (begin_bc_block): Set them.

From-SVN: r217670
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/cp-gimplify.c
gcc/cp/cp-tree.h
gcc/testsuite/g++.dg/cpp1y/constexpr-loop1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/constexpr-return1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/constexpr-return2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/constexpr-switch1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/constexpr-switch2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/constexpr-switch3.C [new file with mode: 0644]