aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-06-26 10:00:33 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-06-26 10:00:33 -0400
commit07a9e891c9cbb1df6aa33edbe39c21d948da2301 (patch)
treeb9daf9f1abc1a91a7cacbb85a1df30a46c2c7cc5 /gcc/cp/init.c
parent4ff10c0ec2db831023cc9c2a3242e8580beb3ec8 (diff)
downloadgcc-07a9e891c9cbb1df6aa33edbe39c21d948da2301.zip
gcc-07a9e891c9cbb1df6aa33edbe39c21d948da2301.tar.gz
gcc-07a9e891c9cbb1df6aa33edbe39c21d948da2301.tar.bz2
re PR c++/49528 (g++ fails to destroy temporary object when subobject is used to initialize a reference)
PR c++/49528 * semantics.c (potential_constant_expression_1): A TARGET_EXPR with a cleanup isn't constant. (cxx_eval_constant_expression): Likewise. * init.c (expand_default_init): Use maybe_constant_init. From-SVN: r175409
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r--gcc/cp/init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 3c347a4..3ceed90 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -1514,7 +1514,7 @@ expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags,
tree fn = get_callee_fndecl (rval);
if (fn && DECL_DECLARED_CONSTEXPR_P (fn))
{
- tree e = maybe_constant_value (rval);
+ tree e = maybe_constant_init (rval);
if (TREE_CONSTANT (e))
rval = build2 (INIT_EXPR, type, exp, e);
}