From: Kai Tietz Date: Fri, 12 Dec 2014 17:14:54 +0000 (+0100) Subject: re PR c++/63996 (Infinite loop in invalid C++14 constexpr fn) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5a5e54cdf872f476a2412f317f8744b13774b3ff;p=gcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1809b26a010..3de8861f792 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 9426d8558e2..732a79cdf18 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))