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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [other/] [access2.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
// Origin: Dirk Mueller 
3
 
4
// PR c++/2739
5
// Access to base class private static member.
6
 
7
class Base {
8
private:
9
  static int fooprivate;
10
protected:
11
  static int fooprotected;
12
public:
13
  static int foopublic;
14
};
15
 
16
class Derived : public Base {
17
public:
18
  void test();
19
};
20
 
21
int Base::fooprivate=42;        // { dg-error "private" }
22
int Base::fooprotected=42;
23
int Base::foopublic=42;
24
 
25
void Derived::test() {
26
  if ( fooprivate );            // { dg-error "context" }
27
  if ( fooprotected );
28
  if ( foopublic );
29
}
30
 
31
int main()
32
{
33
  Derived d;
34
  d.test();
35
}

powered by: WebSVN 2.1.0

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