diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1809b26a0109..3de8861f792d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-12-12 Kai Tietz + + PR c++/63996 + * constexpr.c (cxx_eval_loop_expr): Don't loop + endless on none-constant expression. + 2014-12-12 Jason Merrill PR c++/61402 diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 9426d8558e23..732a79cdf182 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -2841,7 +2841,7 @@ cxx_eval_loop_expr (const constexpr_ctx *ctx, tree t, { cxx_eval_statement_list (ctx, body, non_constant_p, overflow_p, jump_target); - if (returns (jump_target) || breaks (jump_target)) + if (returns (jump_target) || breaks (jump_target) || *non_constant_p) break; } if (breaks (jump_target))