Commit 0798984a by Paolo Carlini Committed by Paolo Carlini

re PR c++/84940 (internal compiler error: in build_value_init_noctor, at cp/init.c:465)

/cp
2018-09-27  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/84940
	* semantics.c (finish_unary_op_expr): Check return value of
	build_x_unary_op for error_mark_node.

/testsuite
2018-09-27  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/84940
	* g++.dg/expr/unary4.C: New.

From-SVN: r264664
parent 291a9e98
2018-09-27 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84940
* semantics.c (finish_unary_op_expr): Check return value of
build_x_unary_op for error_mark_node.
2018-09-25 Jakub Jelinek <jakub@redhat.com>
PR c++/87398
......
......@@ -2727,13 +2727,14 @@ finish_unary_op_expr (location_t op_loc, enum tree_code code, cp_expr expr,
/* TODO: build_x_unary_op doesn't always honor the location. */
result.set_location (combined_loc);
tree result_ovl, expr_ovl;
if (result == error_mark_node)
return result;
if (!(complain & tf_warning))
return result;
result_ovl = result;
expr_ovl = expr;
tree result_ovl = result;
tree expr_ovl = expr;
if (!processing_template_decl)
expr_ovl = cp_fully_fold (expr_ovl);
......
2018-09-27 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84940
* g++.dg/expr/unary4.C: New.
2018-09-26 Indu Bhagat <indu.bhagat@oracle.com>
PR gcov-profile/86957
......
// PR c++/84940
// { dg-additional-options -Wno-vla }
void
foo (int x)
{
struct {} a[1][x](-a[0]); // { dg-error "wrong type argument to unary minus" }
}
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