diff options
author | Jason Merrill <jason@redhat.com> | 2011-06-26 10:00:33 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-06-26 10:00:33 -0400 |
commit | 07a9e891c9cbb1df6aa33edbe39c21d948da2301 (patch) | |
tree | b9daf9f1abc1a91a7cacbb85a1df30a46c2c7cc5 /gcc/cp/init.c | |
parent | 4ff10c0ec2db831023cc9c2a3242e8580beb3ec8 (diff) | |
download | gcc-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.c | 2 |
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); } |