2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.pt / local6.C
blobc03c6cd7ba4953cf2adb3bdfaeecd50607f0fbc4
1 // { dg-do run  }
2 extern "C" void abort();
4 template <class T>
5 int f(T)
7   struct S1 {
8     virtual int foo() { return 1; }
9   };
11   struct S2 : public S1 {
12     int foo() { return 2; }
13   };
15   S1* s2 = new S2;
17   return s2->foo();
21 int main()
23   if (f(3) != 2)
24     abort();