aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1997-12-09 07:26:26 +0000
committerJason Merrill <jason@gcc.gnu.org>1997-12-09 02:26:26 -0500
commit67437d5b5df323841758f4fecd2ed28f8c1f68a2 (patch)
treedff660f4c14b28f54841b564ea62311a1617599c
parent25b76cc193e0c212ba59190a7ee1e47dcdfbb195 (diff)
downloadgcc-67437d5b5df323841758f4fecd2ed28f8c1f68a2.zip
gcc-67437d5b5df323841758f4fecd2ed28f8c1f68a2.tar.gz
gcc-67437d5b5df323841758f4fecd2ed28f8c1f68a2.tar.bz2
decl.c (copy_args_p): Handle copy elision for types with virtual bases.
* decl.c (copy_args_p): Handle copy elision for types with virtual bases. * call.c (build_over_call): Likewise. From-SVN: r17022
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/call.c5
-rw-r--r--gcc/cp/decl.c3
3 files changed, 13 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 2b9a24f..66df1a7 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+Mon Dec 8 23:17:13 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (copy_args_p): Handle copy elision for types with virtual
+ bases.
+ * call.c (build_over_call): Likewise.
+
Sun Dec 7 22:38:12 1997 Mark Mitchell <mmitchell@usa.net>
* pt.c (lookup_template_function): Copy the template arguments,
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 827e904..64f3a97 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -5502,7 +5502,10 @@ build_over_call (fn, convs, args, flags)
&& copy_args_p (fn))
{
tree targ;
- arg = TREE_VALUE (TREE_CHAIN (converted_args));
+ arg = TREE_CHAIN (converted_args);
+ if (TYPE_USES_VIRTUAL_BASECLASSES (DECL_CONTEXT (fn)))
+ arg = TREE_CHAIN (arg);
+ arg = TREE_VALUE (arg);
/* Pull out the real argument, disregarding const-correctness. */
targ = arg;
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 4bcb79c..7ece1d3 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -10280,6 +10280,9 @@ copy_args_p (d)
tree d;
{
tree t = FUNCTION_ARG_CHAIN (d);
+ if (DECL_CONSTRUCTOR_P (d)
+ && TYPE_USES_VIRTUAL_BASECLASSES (DECL_CONTEXT (d)))
+ t = TREE_CHAIN (t);
if (t && TREE_CODE (TREE_VALUE (t)) == REFERENCE_TYPE
&& (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_VALUE (t)))
== DECL_CLASS_CONTEXT (d))