Fix constexpr handling of SAVE_EXPR in loops.
authorJason Merrill <jason@redhat.com>
Fri, 4 Mar 2016 22:08:17 +0000 (17:08 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 4 Mar 2016 22:08:17 +0000 (17:08 -0500)
commit39dce2b7901008b0ba70387bb47a9a0d19bbe836
tree7a6b28f37f7bbf989c2627fb453fe70b47529760
parent602045546463f33fb426f6f623ece65fb41b907e
Fix constexpr handling of SAVE_EXPR in loops.

* constexpr.c (struct constexpr_ctx): Add save_exprs field.
(cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
(cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
(cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.

From-SVN: r233981
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/testsuite/g++.dg/cpp1y/constexpr-loop3.C [new file with mode: 0644]