This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2] Fix c++/67371 (issues with throw in constexpr)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]