This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v2] Fix c++/67371 (issues with throw in constexpr)
- From: Markus Trippelsdorf <markus at trippelsdorf dot de>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 29 Aug 2015 12:53:31 +0200
- Subject: Re: [PATCH v2] Fix c++/67371 (issues with throw in constexpr)
- Authentication-results: sourceware.org; auth=none
- References: <20150828120003 dot GA421 at x4> <55E117BB dot 7080609 at redhat dot com> <20150829101410 dot GA421 at x4>
On 2015.08.29 at 12:14 +0200, Markus Trippelsdorf wrote:
> index 1eacb8be9a44..29a7f1f22169 100644
> --- a/gcc/cp/constexpr.c
> +++ b/gcc/cp/constexpr.c
> @@ -4276,10 +4276,10 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict,
> case IF_STMT:
> if (!RECUR (IF_COND (t), rval))
> return false;
> - if (!RECUR (THEN_CLAUSE (t), any))
> - return false;
> - if (!RECUR (ELSE_CLAUSE (t), any))
> - return false;
> + if (integer_nonzerop (IF_COND (t)) && !RECUR (THEN_CLAUSE (t), any))
> + return false;
> + if (integer_zerop (IF_COND (t)) && !RECUR (ELSE_CLAUSE (t), any))
> + return false;
Sorry for messing up the formating of the return statements. I've fixed
this locally already.
--
Markus