From 658311e053abebc6fa24f2863d81e802e776057e Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 13 Feb 2002 20:59:37 +0000 Subject: [PATCH] * g++.old-deja/g++.other/thunk1.C: New test. From-SVN: r49743 --- gcc/testsuite/ChangeLog | 4 +++ gcc/testsuite/g++.old-deja/g++.other/thunk1.C | 35 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.other/thunk1.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dd610469712..56bd978f7af 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2002-02-13 Richard Smith + + * g++.old-deja/g++.other/thunk1.C: New test. + 2002-02-12 David Billinghurst * g++.dg/warn/weak1.C: weak attributes not supported on cygwin diff --git a/gcc/testsuite/g++.old-deja/g++.other/thunk1.C b/gcc/testsuite/g++.old-deja/g++.other/thunk1.C new file mode 100644 index 00000000000..72ca2ce5008 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/thunk1.C @@ -0,0 +1,35 @@ +extern "C" void abort(); + +int ic; + +struct X +{ + X() { ++ic; } + X( const X & ) { ++ic; } + ~X() { if (--ic < 0) abort(); } +}; + +struct V +{ + virtual ~V() {} +}; + +struct A : public virtual V +{ +}; + +struct B : public virtual V +{ + virtual void foo( X ) = 0; +}; + +struct D : public A, public virtual B +{ + virtual void foo( X ) {} +}; + +int main() +{ + B *b = new D; + b->foo( X() ); +}