Commit 46e318cf by Jason Merrill Committed by Jason Merrill

PR c++/86094 - wrong code with defaulted move ctor.

	* tree.c (type_has_nontrivial_copy_init): Fix move ctor handling.

From-SVN: r261444
parent 641c8da2
2018-06-11 Jason Merrill <jason@redhat.com>
PR c++/86094 - wrong code with defaulted move ctor.
* tree.c (type_has_nontrivial_copy_init): Fix move ctor handling.
2018-06-10 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokfndecl): Use the location_t argument in two more places.
......
......@@ -4135,7 +4135,7 @@ type_has_nontrivial_copy_init (const_tree type)
for (ovl_iterator iter (CLASSTYPE_CONSTRUCTORS (t)); iter; ++iter)
{
tree fn = *iter;
if (copy_fn_p (fn))
if (copy_fn_p (fn) || move_fn_p (fn))
{
saw_copy = true;
if (!DECL_DELETED_FN (fn))
......
// PR c++/86094
// { dg-do compile { target c++11 } }
// { dg-additional-options "-Wabi=11 -fdump-tree-gimple" }
// { dg-final { scan-tree-dump-not "struct S &" "gimple" } }
struct S {
S(S&&) = default;
int i;
};
S foo(S s)
{
return s;
}
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