2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / using6.C
blob272c35dffb6e5ce796b416f992ebe8b3d3a5fa06
1 // { dg-do run  }
2 // Test of class-scope using-declaration for functions.
4 #define assert(COND) if (!(COND)) return 1
6 struct A {
7   int f(int) { return 1; }
8   int f(char) { return 2; }
9 };
11 struct B {
12   int f(double) { return 3; }
15 struct C : public A, public B {
16   using A::f;
17   using B::f;
18   int f(char) { return 4; }
19   int f(C) { return 5; }
22 int main ()
24   C c;
26   assert (c.f(1) == 1);
27   assert (c.f('a') == 4);
28   assert (c.f(2.0) == 3);
29   assert (c.f(c) == 5);