diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2014-01-02 23:43:24 +0100 |
---|---|---|
committer | Marc Glisse <glisse@gcc.gnu.org> | 2014-01-02 22:43:24 +0000 |
commit | 25c541b406c3aa49f9ca4db1982e06c5ec0ef796 (patch) | |
tree | 4e19bd6add06c04a3359a0bb8d2a2115fcd7ed94 /gcc/cp | |
parent | 1a7630623b2bff751688f7a3a30efb8d254e83c1 (diff) | |
download | gcc-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')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/call.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 97e2d74..c77d86f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,11 @@ 2014-01-02 Marc Glisse <marc.glisse@inria.fr> + PR c++/59641 + * call.c (build_conditional_expr_1): Check the return value of + force_rvalue. + +2014-01-02 Marc Glisse <marc.glisse@inria.fr> + * call.c (convert_like_real): Check complain. 2014-01-02 Marc Glisse <marc.glisse@inria.fr> 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); |