OSDN Git Service

PR c++/44158
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 May 2010 19:53:45 +0000 (19:53 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:10:50 +0000 (14:10 +0900)
* call.c (build_over_call): Don't do bitwise copy for move ctor.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159508 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/ChangeLog

index acc111f..f06c6cd 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-17  Jason Merrill  <jason@redhat.com>
+
+       PR c++/44158
+       * call.c (build_over_call): Don't do bitwise copy for move ctor.
+
 2010-05-17  Dodji Seketeli  <dodji@redhat.com>
            Jason Merrill  <jason@redhat.com>
 
 2010-05-17  Dodji Seketeli  <dodji@redhat.com>
            Jason Merrill  <jason@redhat.com>
 
index c063992..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.  */
        }
       /* [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;
        {
          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;
        {
          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
            return build_target_expr_with_type (arg, DECL_CONTEXT (fn));
        }
       else if (TREE_CODE (arg) == TARGET_EXPR
index 17b9c51..67cd4ad 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-17  Jason Merrill  <jason@redhat.com>
+
+       PR c++/44158
+       * g++.dg/cpp0x/rv-trivial-bug.C: Test copy-init too.
+
 2010-05-17  Martin Jambor  <mjambor@suse.cz>
 
        * g++.dg/ipa/ivinline-1.C: New test.
 2010-05-17  Martin Jambor  <mjambor@suse.cz>
 
        * g++.dg/ipa/ivinline-1.C: New test.