OSDN Git Service

PR c++/23372
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Aug 2006 04:27:43 +0000 (04:27 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Aug 2006 04:27:43 +0000 (04:27 +0000)
        * call.c (build_over_call): Don't make a copy here if build_call
        will make one too.

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

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

index f50554c..ff60084 100644 (file)
@@ -1,3 +1,9 @@
+2006-08-22  Jason Merrill  <jason@redhat.com>
+
+       PR c++/23372
+       * call.c (build_over_call): Don't make a copy here if build_call 
+       will make one too.
+
 2006-08-22  Andrew Pinski  <pinskia@physics.uc.edu>
 
        PR C++/28450
index ea89cdf..a91ecd0 100644 (file)
@@ -4847,6 +4847,12 @@ build_over_call (struct z_candidate *cand, int flags)
       tree type = TREE_VALUE (parm);
 
       conv = convs[i];
+
+      /* Don't make a copy here if build_call is going to.  */
+      if (conv->kind == ck_rvalue
+         && !TREE_ADDRESSABLE (complete_type (type)))
+       conv = conv->u.next;
+
       val = convert_like_with_context
        (conv, TREE_VALUE (arg), fn, i - is_method);