* tree.c (type_has_nontrivial_copy_init): Fix move ctor handling.
From-SVN: r261444
+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.
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))
--- /dev/null
+// 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;
+}