aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/call.c
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2014-01-02 23:43:24 +0100
committerMarc Glisse <glisse@gcc.gnu.org>2014-01-02 22:43:24 +0000
commit25c541b406c3aa49f9ca4db1982e06c5ec0ef796 (patch)
tree4e19bd6add06c04a3359a0bb8d2a2115fcd7ed94 /gcc/cp/call.c
parent1a7630623b2bff751688f7a3a30efb8d254e83c1 (diff)
downloadgcc-25c541b406c3aa49f9ca4db1982e06c5ec0ef796.zip
gcc-25c541b406c3aa49f9ca4db1982e06c5ec0ef796.tar.gz
gcc-25c541b406c3aa49f9ca4db1982e06c5ec0ef796.tar.bz2
re PR c++/59641 (ICE with invalid expression in vector arithmetic)
2014-01-02 Marc Glisse <marc.glisse@inria.fr> PR c++/59641 gcc/cp/ * call.c (build_conditional_expr_1): Check the return value of force_rvalue. gcc/testsuite/ * g++.dg/cpp0x/pr59641.C: New file. From-SVN: r206303
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r--gcc/cp/call.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index bff9871..46b3748 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -4402,6 +4402,12 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3,
arg2 = force_rvalue (arg2, complain);
arg3 = force_rvalue (arg3, complain);
+ /* force_rvalue can return error_mark on valid arguments. */
+ if (error_operand_p (arg1)
+ || error_operand_p (arg2)
+ || error_operand_p (arg3))
+ return error_mark_node;
+
tree arg1_type = TREE_TYPE (arg1);
arg2_type = TREE_TYPE (arg2);
arg3_type = TREE_TYPE (arg3);