summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.bugs/900330_02.C
blob: 85c40f0e8d9ba8d2a9a5d9171d4bc354120c5e35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// g++ 1.37.1 bug 900330_02

// The C++ Reference Manual says in section 13.1:

// "Two function declarations of the same name refer to the same function
// if they are in the same scope and have identical argument types.  A
// function member of a derived class is *not* in the same scope as a function
// member of the same name in a base class."

// g++ fails to correctly detect the error indicated.

// Cfront 2.0 passes this test.

// keywords: function, member, overloading, hiding

struct B {
  int f(int);
};

struct D : public B {
  int f(struct B);		// ERROR - referred to below
};

void h(D* pd)
{
  pd->f(1);		// ERROR - D::f(struct B) hides B::f(int)
}

int main () { return 0; }