diff options
author | aaw <aaw@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-31 15:47:29 +0000 |
---|---|---|
committer | aaw <aaw@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-31 15:47:29 +0000 |
commit | 63ade1d898927dcd4c9544d17bcd44688fb7d6a6 (patch) | |
tree | 589f7daabbc93367a0dc703715ace6fc0735ea07 /gcc/cp/call.c | |
parent | f44ba3727388ceb1bb3ed7b1b4bcae6e1438898c (diff) | |
download | gcc-63ade1d898927dcd4c9544d17bcd44688fb7d6a6.tar.gz |
2012-08-31 Ollie Wild <aaw@google.com>
PR c++/54197
* gcc/cp/call.c (extend_ref_init_temps_1): Handle COMPOUND_EXPR trees.
* gcc/testsuite/g++.dg/init/lifetime3.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190834 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r-- | gcc/cp/call.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 3915738e516..4d65b3e6ddd 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -8916,6 +8916,12 @@ extend_ref_init_temps_1 (tree decl, tree init, VEC(tree,gc) **cleanups) tree sub = init; tree *p; STRIP_NOPS (sub); + if (TREE_CODE (sub) == COMPOUND_EXPR) + { + TREE_OPERAND (sub, 1) + = extend_ref_init_temps_1 (decl, TREE_OPERAND (sub, 1), cleanups); + return init; + } if (TREE_CODE (sub) != ADDR_EXPR) return init; /* Deal with binding to a subobject. */ |