PR c++/68983 (FE)

PR c++/67557
	* call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.

From-SVN: r232166
This commit is contained in:
Jason Merrill 2016-01-08 11:01:05 -05:00 committed by Jason Merrill
parent 8babc12b22
commit 0795b6f262
3 changed files with 22 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2016-01-08 Jason Merrill <jason@redhat.com>
PR c++/68983
PR c++/67557
* call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
2016-01-05 Nathan Sidwell <nathan@acm.org>
PR c++/58583

View File

@ -7161,6 +7161,9 @@ unsafe_copy_elision_p (tree target, tree exp)
&& resolves_to_fixed_type_p (target, NULL))
return false;
tree init = TARGET_EXPR_INITIAL (exp);
/* build_compound_expr pushes COMPOUND_EXPR inside TARGET_EXPR. */
while (TREE_CODE (init) == COMPOUND_EXPR)
init = TREE_OPERAND (init, 1);
return (TREE_CODE (init) == AGGR_INIT_EXPR
&& !AGGR_INIT_VIA_CTOR_P (init));
}

View File

@ -0,0 +1,13 @@
// PR c++/67557
class A {
public:
A m_fn1();
A(A const &);
int *L;
int ref;
};
struct B : A {
B();
};
B::B() : A((0, m_fn1())) {}