Commit 982058cb by Paolo Carlini

re PR c++/53491 (ICE in build_target_expr_with_type, at cp/tree.c:587)

/cp
2012-05-26  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/53491
	* tree.c (stabilize_expr): Handle exp of void type.

/testsuite
2012-05-26  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/53491
	* g++.dg/parse/crash60.C: New.

From-SVN: r187917
parent 1f37c583
2012-05-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53491
* tree.c (stabilize_expr): Handle exp of void type.
2012-05-26 Jason Merrill <jason@redhat.com> 2012-05-26 Jason Merrill <jason@redhat.com>
PR c++/53220 PR c++/53220
......
...@@ -3281,6 +3281,11 @@ stabilize_expr (tree exp, tree* initp) ...@@ -3281,6 +3281,11 @@ stabilize_expr (tree exp, tree* initp)
if (!TREE_SIDE_EFFECTS (exp)) if (!TREE_SIDE_EFFECTS (exp))
init_expr = NULL_TREE; init_expr = NULL_TREE;
else if (VOID_TYPE_P (TREE_TYPE (exp)))
{
*initp = exp;
return void_zero_node;
}
/* There are no expressions with REFERENCE_TYPE, but there can be call /* There are no expressions with REFERENCE_TYPE, but there can be call
arguments with such a type; just treat it as a pointer. */ arguments with such a type; just treat it as a pointer. */
else if (TREE_CODE (TREE_TYPE (exp)) == REFERENCE_TYPE else if (TREE_CODE (TREE_TYPE (exp)) == REFERENCE_TYPE
......
2012-05-22 Jason Merrill <jason@redhat.com> 2012-05-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53491
* g++.dg/parse/crash60.C: New.
2012-05-26 Jason Merrill <jason@redhat.com>
PR c++/53220 PR c++/53220
* c-c++-common/array-lit.c: New. * c-c++-common/array-lit.c: New.
......
// PR c++/53491
struct M
{
void pop();
};
void foo()
{
int result = 0;
M m;
result += m.pop(); // { dg-error "invalid operands|in evaluation" }
}
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