diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f5ba6af90961..89cbc90fdd2c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,7 @@ 2012-05-30 Jason Merrill + * tree.c (stabilize_expr): Tweak logic. + PR c++/53356 * tree.c (stabilize_init): Side effects make the init unstable. diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 897d4d7bb374..4e7056fc3641 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -3283,8 +3283,8 @@ stabilize_expr (tree exp, tree* initp) init_expr = NULL_TREE; else if (VOID_TYPE_P (TREE_TYPE (exp))) { - *initp = exp; - return void_zero_node; + init_expr = exp; + exp = 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. */