2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / template / using4.C
blob8c46da464a12fd7f72fd91a33b7b8c20478e0eb6
1 // { dg-do run }
3 // Copyright (C) 2003 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 22 Jul 2003 <nathan@codesourcery.com>
6 // PR 9447. Using decls in template classes.
8 template <class T>
9 struct Foo {
10   int k (float) {return 1;}
13 struct Baz 
15   int k (int) {return 2;}
18 template <class T>
19 struct Bar : public Foo<T> , Baz {
20   using Foo<T>::k;
21   using Baz::k;
23   int foo()
24   {
25     if (k (1.0f) != 1)
26       return 1;
27     if (k (1) != 2)
28       return 2;
30     return 0;
31   }
34 int main()
36   Bar<int> bar;
38   return bar.foo();