FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900330_02.C
blob85c40f0e8d9ba8d2a9a5d9171d4bc354120c5e35
1 // g++ 1.37.1 bug 900330_02
3 // The C++ Reference Manual says in section 13.1:
5 // "Two function declarations of the same name refer to the same function
6 // if they are in the same scope and have identical argument types.  A
7 // function member of a derived class is *not* in the same scope as a function
8 // member of the same name in a base class."
10 // g++ fails to correctly detect the error indicated.
12 // Cfront 2.0 passes this test.
14 // keywords: function, member, overloading, hiding
16 struct B {
17   int f(int);
20 struct D : public B {
21   int f(struct B);              // ERROR - referred to below
24 void h(D* pd)
26   pd->f(1);             // ERROR - D::f(struct B) hides B::f(int)
29 int main () { return 0; }