aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2022-10-25 13:54:12 -0400
committerJason Merrill <jason@redhat.com>2022-10-25 14:05:18 -0400
commit4a54873d7753068fe64e01efd5d8a06615bdb167 (patch)
treeacc537700751e15ea11466ce1d67178db3a9e5b8 /gcc
parent15d67c11ac0479b08e3badcafdee7e0a6f062349 (diff)
downloadgcc-4a54873d7753068fe64e01efd5d8a06615bdb167.zip
gcc-4a54873d7753068fe64e01efd5d8a06615bdb167.tar.gz
gcc-4a54873d7753068fe64e01efd5d8a06615bdb167.tar.bz2
c++: correct fold_operand change
Still want the conversion to bool. gcc/cp/ChangeLog: * constexpr.cc (find_failing_clause_r): Re-add the call to contextual_conv_bool.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/constexpr.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc
index 39bb023..15b4f2c 100644
--- a/gcc/cp/constexpr.cc
+++ b/gcc/cp/constexpr.cc
@@ -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;