aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/call.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2005-11-03 01:25:13 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2005-11-03 01:25:13 +0000
commit3a0588c4e01a7cbeaf3a54360ffaba27fc8caf25 (patch)
tree661d0838f488e6d552b82cd1954a06b88e0521ff /gcc/cp/call.c
parent85ffcaf2920a5e4af5754ec5a1735c5d6b47f037 (diff)
downloadgcc-3a0588c4e01a7cbeaf3a54360ffaba27fc8caf25.zip
gcc-3a0588c4e01a7cbeaf3a54360ffaba27fc8caf25.tar.gz
gcc-3a0588c4e01a7cbeaf3a54360ffaba27fc8caf25.tar.bz2
re PR c++/22434 (ICE in simplify_{,gen_}subreg)
PR c++/22434 * call.c (build_conditional_expr): Do bad conversions, if there's no other choice. PR c++/22434 * g++.dg/expr/cond8.C: New test. From-SVN: r106418
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r--gcc/cp/call.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 77cbe2a..99b8bcb 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -3281,13 +3281,13 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3)
error ("operands to ?: have different types");
result = error_mark_node;
}
- else if (conv2 && !conv2->bad_p)
+ else if (conv2 && (!conv2->bad_p || !conv3))
{
arg2 = convert_like (conv2, arg2);
arg2 = convert_from_reference (arg2);
arg2_type = TREE_TYPE (arg2);
}
- else if (conv3 && !conv3->bad_p)
+ else if (conv3 && (!conv3->bad_p || !conv2))
{
arg3 = convert_like (conv3, arg3);
arg3 = convert_from_reference (arg3);