OSDN Git Service

cp:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.pt / local6.C
1 extern "C" void abort();
2
3 template <class T>
4 int f(T)
5 {
6   struct S1 {
7     virtual int foo() { return 1; }
8   };
9
10   struct S2 : public S1 {
11     int foo() { return 2; }
12   };
13
14   S1* s2 = new S2;
15
16   return s2->foo();
17 }
18
19
20 int main()
21 {
22   if (f(3) != 2)
23     abort();
24 }