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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.dg/] [parse/] [access6.C] - Diff between revs 301 and 338

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

Rev 301 Rev 338
// { dg-do compile }
// { dg-do compile }
// Origin: David Baron 
// Origin: David Baron 
// PR c++/3765: Changing access from public to private by member
// PR c++/3765: Changing access from public to private by member
// using declaration.
// using declaration.
class A
class A
{
{
  public:
  public:
    int foo() { return 1; }     // { dg-error "inaccessible" }
    int foo() { return 1; }     // { dg-error "inaccessible" }
};
};
class B : public A
class B : public A
{
{
  private:
  private:
    using A::foo;
    using A::foo;
};
};
int main()
int main()
{
{
  B b;
  B b;
  return b.foo();               // { dg-error "this context" }
  return b.foo();               // { dg-error "this context" }
}
}
 
 

powered by: WebSVN 2.1.0

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