2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.benjamin / 14687.C
blob494f75c56b5314ef01f5a372b2126e78ce3f5d47
1 // { dg-do run  }
2 // 981203 bkoz
3 // g++/14687
5 #include <assert.h>
6 unsigned int gtest;
8 // 7.3.3 the using declaration
10 // p 3
11 struct belieze {
12   void f(char);
13   void g(char);
14   enum E { e };
15   union { int x; };
18 struct dominica: belieze {
19   using belieze::f;
20   void f(int i) { f('c'); } // calls belieze::f(char)
21   void g(int i) { g('c'); } // recursively calls dominca::g(int)
25 // p 6
26 namespace A {
27   void f(int i) { gtest = 1; }
30 using A::f;      //f is a synonym for A::f, that is for A::f(int)
32 namespace A {
33   void f(char c) { gtest = 3; }
36 void foo(void) {
37   f('a');        //calls f(int), even though A::f(char) exits
38   assert (gtest = 1);
41 void bar(void) {
42   using A::f;    //f is a synonm for A::f, that is for A::f(int) and A::f(char)
43   f('a');        //calls f(char)
44   assert (gtest = 3);
47 int main(void)
49   foo();
50   bar();
52   return 0;