Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.dg / template / overload7.C
blob28bd16c4e54022fcd0dc0a40689ff4d5054eb678
1 // { dg-do run }
3 // Copyright (C) 2005 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 17 Oct 2005 <nathan@codesourcery.com>
6 // PR 24386:Wrong virtual function called
7 // Origin:  Scott Snyder snyder@fnal.gov
9 struct A
11   virtual int Foo () { return 1; }
13 struct B : public A
15   virtual int Foo () { return 2; }
18 template <class T>
19 int Bar (T *a)
21   if (static_cast<A*>(a)->A::Foo () != 1)
22     return 1;
23   if (static_cast<A*>(a)->Foo () != 2)
24     return 2;
25   return 0;
28 int main ()
30   return Bar (new B);