OSDN Git Service

PR c++/44158
[pf3gnuchains/gcc-fork.git] / gcc / cp / call.c
index 6ed53dc..5d13007 100644 (file)
@@ -5776,7 +5776,8 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
        }
       /* [class.copy]: the copy constructor is implicitly defined even if
         the implementation elided its use.  */
-      else if (TYPE_HAS_COMPLEX_INIT_REF (DECL_CONTEXT (fn)))
+      else if (TYPE_HAS_COMPLEX_INIT_REF (DECL_CONTEXT (fn))
+              || move_fn_p (fn))
        {
          mark_used (fn);
          already_used = true;
@@ -5794,7 +5795,8 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
        {
          if (TREE_CODE (arg) == TARGET_EXPR)
            return arg;
-         else if (TYPE_HAS_TRIVIAL_INIT_REF (DECL_CONTEXT (fn)))
+         else if (TYPE_HAS_TRIVIAL_INIT_REF (DECL_CONTEXT (fn))
+                  && !move_fn_p (fn))
            return build_target_expr_with_type (arg, DECL_CONTEXT (fn));
        }
       else if (TREE_CODE (arg) == TARGET_EXPR
@@ -6443,8 +6445,8 @@ build_new_method_call (tree instance, tree fns, VEC(tree,gc) **args,
            /* This is not an error, it is runtime undefined
               behavior.  */
            warning (0, (DECL_CONSTRUCTOR_P (current_function_decl) ?
-                     "abstract virtual %q#D called from constructor"
-                     : "abstract virtual %q#D called from destructor"),
+                     "pure virtual %q#D called from constructor"
+                     : "pure virtual %q#D called from destructor"),
                     fn);
 
          if (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE