diff options
author | Jason Merrill <jason@redhat.com> | 2014-05-09 14:15:46 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-05-09 14:15:46 -0400 |
commit | bb8b1f696ecc30435b210cbcb4d0c575a3e81df1 (patch) | |
tree | 555e71a940d117216df9f162a853899c14e039f6 /gcc/cp | |
parent | ea58ef42e54fde03cc8e57cfb59c4c5d7ec1806a (diff) | |
download | gcc-bb8b1f696ecc30435b210cbcb4d0c575a3e81df1.zip gcc-bb8b1f696ecc30435b210cbcb4d0c575a3e81df1.tar.gz gcc-bb8b1f696ecc30435b210cbcb4d0c575a3e81df1.tar.bz2 |
re PR c++/22434 (ICE in simplify_{,gen_}subreg)
PR c++/22434
* call.c (build_conditional_expr_1): Don't try to pool cv-quals
if we didn't find a conversion.
Don't accept a bad conversion too early.
From-SVN: r210281
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/call.c | 7 |
2 files changed, 11 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3d400bb..232ceec 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2014-05-09 Jason Merrill <jason@redhat.com> + + PR c++/22434 + * call.c (build_conditional_expr_1): Don't try to pool cv-quals + if we didn't find a conversion. + Don't accept a bad conversion too early. + 2014-05-08 Paolo Carlini <paolo.carlini@oracle.com> PR c++/13981 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 857df57..691e9e3 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -4714,7 +4714,7 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3, arg2_type, arg3_type); result = error_mark_node; } - else if (conv2 && (!conv2->bad_p || !conv3)) + else if (conv2 && !conv2->bad_p) { arg2 = convert_like (conv2, arg2, complain); arg2 = convert_from_reference (arg2); @@ -4727,7 +4727,7 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3, if (error_operand_p (arg2)) result = error_mark_node; } - else if (conv3 && (!conv3->bad_p || !conv2)) + else if (conv3 && !conv3->bad_p) { arg3 = convert_like (conv3, arg3, complain); arg3 = convert_from_reference (arg3); @@ -4757,7 +4757,8 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3, conditional expression failing altogether, even though, according to this step, the one operand could be converted to the type of the other. */ - if ((conv2 || conv3) + if (((conv2 && !conv2->bad_p) + || (conv3 && !conv3->bad_p)) && CLASS_TYPE_P (arg2_type) && cp_type_quals (arg2_type) != cp_type_quals (arg3_type)) arg2_type = arg3_type = |