aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/abi
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2002-10-22 05:04:48 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2002-10-22 05:04:48 +0000
commit7ba539c6661a5388eaa28eeae37fd7f1d24eb660 (patch)
tree4b99387bab5f35027f255ee22e338f0031a4d558 /gcc/testsuite/g++.dg/abi
parent5e26e5a278abef7e0b5df09fcf54de6915fd4497 (diff)
downloadgcc-7ba539c6661a5388eaa28eeae37fd7f1d24eb660.zip
gcc-7ba539c6661a5388eaa28eeae37fd7f1d24eb660.tar.gz
gcc-7ba539c6661a5388eaa28eeae37fd7f1d24eb660.tar.bz2
class.c (empty_base_at_nonzero_offset_p): New function.
* class.c (empty_base_at_nonzero_offset_p): New function. (layout_nonempty_base_or_field): Do not check for conflicts when laying out a virtual base using the GCC 3.2 ABI. (build_base_field): Correct checking for presence of empty classes at non-zero offsets when clearing CLASSTYPE_NEARLY_EMPTY_P. * g++.dg/abi/vbase13.C: New test. * g++.dg/abi/vbase14.C: Likewise. From-SVN: r58397
Diffstat (limited to 'gcc/testsuite/g++.dg/abi')
-rw-r--r--gcc/testsuite/g++.dg/abi/vbase13.C17
-rw-r--r--gcc/testsuite/g++.dg/abi/vbase14.C6
2 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/abi/vbase13.C b/gcc/testsuite/g++.dg/abi/vbase13.C
new file mode 100644
index 0000000..6a0bff4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/vbase13.C
@@ -0,0 +1,17 @@
+// { dg-do run }
+// { dg-options "-fabi-version=0 -w" }
+
+struct E1 {};
+struct E2 : public E1 {};
+struct E : public E1, public E2 {};
+struct N : public E { virtual void f () {} };
+
+struct X : virtual public N {
+};
+
+int main () {
+ X x;
+ /* N should not be the primary base of X; it is not nearly empty. */
+ if ((void*)&x == (void*)(N*)&x)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.dg/abi/vbase14.C b/gcc/testsuite/g++.dg/abi/vbase14.C
new file mode 100644
index 0000000..99290b8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/vbase14.C
@@ -0,0 +1,6 @@
+// { dg-options "-Wabi" }
+
+struct E1 {};
+struct E2 : public E1 {}; // { dg-warning "layout" }
+struct E : public E1, public E2 {}; // { dg-warning "layout|ambiguity" }
+struct N : public E { virtual void f () {} }; // { dg-warning "nearly" }