aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2006-08-23 00:27:43 -0400
committerJason Merrill <jason@gcc.gnu.org>2006-08-23 00:27:43 -0400
commita5c4274085d61311898360920cef526334674cd3 (patch)
treef57a654d7d398768f77828698988e68d40c86e2e
parentc846e8cd67a090651ee98d52fb6fbc14a80a4fad (diff)
downloadgcc-a5c4274085d61311898360920cef526334674cd3.zip
gcc-a5c4274085d61311898360920cef526334674cd3.tar.gz
gcc-a5c4274085d61311898360920cef526334674cd3.tar.bz2
re PR c++/23372 (Temporary aggregate copy not elided when passing parameters by value)
PR c++/23372 * call.c (build_over_call): Don't make a copy here if build_call will make one too. From-SVN: r116342
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/call.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f50554c..ff60084 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index ea89cdf..a91ecd0 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -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);