OSDN Git Service

* g++.old-deja/g++.other/thunk1.C: New test.
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 13 Feb 2002 20:59:37 +0000 (20:59 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 13 Feb 2002 20:59:37 +0000 (20:59 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49743 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.other/thunk1.C [new file with mode: 0644]

index dd61046..56bd978 100644 (file)
@@ -1,3 +1,7 @@
+2002-02-13  Richard Smith <richard@ex-parrot.com>
+
+       * g++.old-deja/g++.other/thunk1.C: New test.
+
 2002-02-12  David Billinghurst <David.Billinghurst@riotinto.com>
 
        * 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 (file)
index 0000000..72ca2ce
--- /dev/null
@@ -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() );
+}