]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/23372 (Temporary aggregate copy not elided when passing parameters by value)
authorJason Merrill <jason@redhat.com>
Wed, 23 Aug 2006 14:22:41 +0000 (10:22 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 23 Aug 2006 14:22:41 +0000 (10:22 -0400)
        PR c++/23372
        * call.c (build_over_call): Don't make a copy here if build_call
        will make one too.

From-SVN: r116351

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

index 0f842278c763d954b9e8dd154cd594330c0971b4..c865690eb00afb65d79df706cd5b2c0354ddaa3e 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-17  Jason Merrill  <jason@redhat.com>
 
        PR c++/28385
index aaee1fb36c9e636274b116845f5f6a3365be0cff..da3ea1da226bd341cdab4748fb8ab672833bd46e 100644 (file)
@@ -4780,6 +4780,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);