OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.bugs/] [900330_02.C] - Diff between revs 305 and 338

Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 338
// { dg-do assemble  }
// { dg-do assemble  }
// g++ 1.37.1 bug 900330_02
// g++ 1.37.1 bug 900330_02
// The C++ Reference Manual says in section 13.1:
// The C++ Reference Manual says in section 13.1:
// "Two function declarations of the same name refer to the same function
// "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
// 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
// function member of a derived class is *not* in the same scope as a function
// member of the same name in a base class."
// member of the same name in a base class."
// g++ fails to correctly detect the error indicated.
// g++ fails to correctly detect the error indicated.
// Cfront 2.0 passes this test.
// Cfront 2.0 passes this test.
// keywords: function, member, overloading, hiding
// keywords: function, member, overloading, hiding
struct B {
struct B {
  int f(int);
  int f(int);
};
};
struct D : public B {
struct D : public B {
  int f(struct B);              // { dg-message "candidate is" } referred to below
  int f(struct B);              // { dg-message "candidate is" } referred to below
};
};
void h(D* pd)
void h(D* pd)
{
{
  pd->f(1);             // { dg-error "no matching" } D::f(struct B) hides B::f(int)
  pd->f(1);             // { dg-error "no matching" } D::f(struct B) hides B::f(int)
}
}
int main () { return 0; }
int main () { return 0; }
 
 

powered by: WebSVN 2.1.0

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