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
This commit is contained in:
parent
1f37c58399
commit
982058cbc9
4 changed files with 30 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
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>
|
||||
|
||||
PR c++/53220
|
||||
|
|
|
@ -3281,6 +3281,11 @@ stabilize_expr (tree exp, tree* initp)
|
|||
|
||||
if (!TREE_SIDE_EFFECTS (exp))
|
||||
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
|
||||
arguments with such a type; just treat it as a pointer. */
|
||||
else if (TREE_CODE (TREE_TYPE (exp)) == REFERENCE_TYPE
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
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
|
||||
* c-c++-common/array-lit.c: New.
|
||||
|
|
14
gcc/testsuite/g++.dg/parse/crash60.C
Normal file
14
gcc/testsuite/g++.dg/parse/crash60.C
Normal file
|
@ -0,0 +1,14 @@
|
|||
// PR c++/53491
|
||||
|
||||
struct M
|
||||
{
|
||||
void pop();
|
||||
};
|
||||
|
||||
void foo()
|
||||
{
|
||||
int result = 0;
|
||||
M m;
|
||||
|
||||
result += m.pop(); // { dg-error "invalid operands|in evaluation" }
|
||||
}
|
Loading…
Add table
Reference in a new issue