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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [other/] [access2.C] - Rev 316

Go to most recent revision | Compare with Previous | Blame | View Log

// { dg-do compile }
// Origin: Dirk Mueller <dmuell@gmx.net>

// PR c++/2739
// Access to base class private static member.

class Base {
private:
  static int fooprivate;
protected:
  static int fooprotected;
public:
  static int foopublic;
};

class Derived : public Base {
public:
  void test();
};

int Base::fooprivate=42;        // { dg-error "private" }
int Base::fooprotected=42;
int Base::foopublic=42;

void Derived::test() {
  if ( fooprivate );            // { dg-error "context" }
  if ( fooprotected );
  if ( foopublic );
}

int main()
{
  Derived d;
  d.test();
}

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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