aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2002-03-18 11:55:11 -0500
committerJason Merrill <jason@gcc.gnu.org>2002-03-18 11:55:11 -0500
commitb663bcf33f3ea2b7b6a4cf60da9c9c76b1a82255 (patch)
tree4a86aa282ac50ebe20af3e75f985b9593405dbc2
parentcbb927448701d9be3470beccedda24379db7faf4 (diff)
downloadgcc-b663bcf33f3ea2b7b6a4cf60da9c9c76b1a82255.zip
gcc-b663bcf33f3ea2b7b6a4cf60da9c9c76b1a82255.tar.gz
gcc-b663bcf33f3ea2b7b6a4cf60da9c9c76b1a82255.tar.bz2
PR c++/4222, c++/5995
PR c++/4222, c++/5995 * call.c (build_over_call): Fix empty class logic. From-SVN: r50978
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/call.c3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/empty1.C4
3 files changed, 6 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c5b30b7..12d865e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2002-03-18 Jason Merrill <jason@redhat.com>
+ PR c++/4222, c++/5995
+ * call.c (build_over_call): Fix empty class logic.
+
PR c++/3870
* cp-tree.h (struct saved_scope): Add last_parms field.
* decl.c (maybe_push_to_top_level): Save last_function_parms.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 0cb7dfc..9d26861 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -4256,7 +4256,8 @@ build_over_call (cand, args, flags)
be touched as it might overlay things. When the
gcc core learns about empty classes, we can treat it
like other classes. */
- && !is_empty_class (DECL_CONTEXT (fn)))
+ && !(is_empty_class (DECL_CONTEXT (fn))
+ && TYPE_HAS_TRIVIAL_INIT_REF (DECL_CONTEXT (fn))))
{
tree address;
tree to = stabilize_reference
diff --git a/gcc/testsuite/g++.old-deja/g++.other/empty1.C b/gcc/testsuite/g++.old-deja/g++.other/empty1.C
index a876ce8..b54490c 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/empty1.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/empty1.C
@@ -2,9 +2,7 @@
// This test case checks that the return value optimization works for
// empty classes.
-// xfailed because empty classes clobbering what they overlay as the
-// backend treats them as single byte objects. See bug 4222
-// execution test - XFAIL *-*-*
+// PR c++/5995
extern "C" void abort();
extern "C" int printf (const char *, ...);