OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.bugs/] [900330_02.C] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do assemble  }
2
// g++ 1.37.1 bug 900330_02
3
 
4
// The C++ Reference Manual says in section 13.1:
5
 
6
// "Two function declarations of the same name refer to the same function
7
// if they are in the same scope and have identical argument types.  A
8
// function member of a derived class is *not* in the same scope as a function
9
// member of the same name in a base class."
10
 
11
// g++ fails to correctly detect the error indicated.
12
 
13
// Cfront 2.0 passes this test.
14
 
15
// keywords: function, member, overloading, hiding
16
 
17
struct B {
18
  int f(int);
19
};
20
 
21
struct D : public B {
22
  int f(struct B);              // { dg-error "" } referred to below
23
};
24
 
25
void h(D* pd)
26
{
27
  pd->f(1);             // { dg-error "" } D::f(struct B) hides B::f(int)
28
}
29
 
30
int main () { return 0; }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.