Commit 0795b6f2 by Jason Merrill Committed by Jason Merrill

PR c++/68983 (FE)

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

From-SVN: r232166
parent 8babc12b
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> 2016-01-05 Nathan Sidwell <nathan@acm.org>
PR c++/58583 PR c++/58583
......
...@@ -7161,6 +7161,9 @@ unsafe_copy_elision_p (tree target, tree exp) ...@@ -7161,6 +7161,9 @@ unsafe_copy_elision_p (tree target, tree exp)
&& resolves_to_fixed_type_p (target, NULL)) && resolves_to_fixed_type_p (target, NULL))
return false; return false;
tree init = TARGET_EXPR_INITIAL (exp); 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 return (TREE_CODE (init) == AGGR_INIT_EXPR
&& !AGGR_INIT_VIA_CTOR_P (init)); && !AGGR_INIT_VIA_CTOR_P (init));
} }
......
// 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())) {}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment