Commit 25c541b4 by Marc Glisse Committed by Marc Glisse

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
parent 1a763062
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>
......
......@@ -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);
......
2014-01-02 Marc Glisse <marc.glisse@inria.fr>
PR c++/59641
* g++.dg/cpp0x/pr59641.C: New file.
2014-01-02 Marc Glisse <marc.glisse@inria.fr>
* g++.dg/cpp0x/initlist-explicit-sfinae.C: New file.
2014-01-02 Marc Glisse <marc.glisse@inria.fr>
......
// { dg-options "-std=gnu++11" }
typedef int T __attribute__((vector_size(2*sizeof(int))));
void foo(T& r, const T& a, const T& b)
{
constexpr T c = a < b; // { dg-error "constant" }
r = c ? a : b;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment