diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.brendan/template3.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.brendan/template3.C | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/template3.C b/gcc/testsuite/g++.old-deja/g++.brendan/template3.C deleted file mode 100644 index 3900421d12f..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.brendan/template3.C +++ /dev/null @@ -1,49 +0,0 @@ -// GROUPS passed templates -extern "C" void printf (char *, ...); -extern "C" void exit (int); - -int count = 0; - -void -die (int x) -{ - if (x != ++count) - { - printf ("FAIL\n"); - exit (1); - } -} - -class A { - public: - void f() const { die (-1); } -}; - - -template <class Item> -class B : public A { - public: - void f() const; -}; - -template <class Item> -inline void B<Item>::f() const { die (1); } - -template <class Item> -class C : public A { - public: - void f() const { die (2); } -}; - - -int main() -{ - B<int> b; - C<int> c; - - b.f(); //- bugged, (A::f() called instead of B::f()) - c.f(); //- works fine (C::f() called) - - printf ("PASS\n"); - return 0; -} |