]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: correct fold_operand change
authorJason Merrill <jason@redhat.com>
Tue, 25 Oct 2022 17:54:12 +0000 (13:54 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 25 Oct 2022 18:05:18 +0000 (14:05 -0400)
Still want the conversion to bool.

gcc/cp/ChangeLog:

* constexpr.cc (find_failing_clause_r): Re-add the call to
contextual_conv_bool.

gcc/cp/constexpr.cc

index 39bb023b79c27bfcecad065220bc7b781b696305..15b4f2c4a080cb7373766d745f13f6ce12d1d07f 100644 (file)
@@ -1887,7 +1887,8 @@ find_failing_clause_r (const constexpr_ctx *ctx, tree expr)
        e = find_failing_clause_r (ctx, TREE_OPERAND (expr, 1));
       return e;
     }
-  tree e = fold_operand (expr, ctx);
+  tree e = contextual_conv_bool (expr, tf_none);
+  e = fold_operand (e, ctx);
   if (integer_zerop (e))
     /* This is the failing clause.  */
     return expr;