2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-03-21 23:30:59 +08:00

re PR c++/63996 (Infinite loop in invalid C++14 constexpr fn)

PR c++/63996
	* constexpr.c (cxx_eval_loop_expr): Don't loop
	endless on none-constant expression.

From-SVN: r218682
This commit is contained in:
Kai Tietz 2014-12-12 18:14:54 +01:00 committed by Kai Tietz
parent 32b671f05a
commit 5a5e54cdf8
2 changed files with 7 additions and 1 deletions

@ -1,3 +1,9 @@
2014-12-12 Kai Tietz <ktietz@redhat.com>
PR c++/63996
* constexpr.c (cxx_eval_loop_expr): Don't loop
endless on none-constant expression.
2014-12-12 Jason Merrill <jason@redhat.com>
PR c++/61402

@ -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))