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++.old-deja/] [g++.law/] [arm12.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do assemble  }
2
// GROUPS passed ARM-compliance
3
// arm file
4
// From: belley@cae.ca (Benoit Belley 3218)
5
// Subject: Bad access control with private constructor and derivation
6
// Date: Fri, 28 May 1993 12:39:57 -0400 (EDT)
7
 
8
#include 
9
 
10
class X
11
{
12
public:
13
  void f();
14
 
15
private:
16
  X();
17
};
18
 
19
class Y : public X
20
{
21
public:
22
  Y();
23
};
24
 
25
X::X() // { dg-error "is private" }
26
{
27
  std::cout << "X::X()" << std::endl;
28
}
29
 
30
void X::f()
31
{
32
  std::cout << "X::f()" << std::endl;
33
}
34
 
35
Y::Y() // { dg-error "within this context" }
36
{
37
  std::cout << "Y::Y()" << std::endl;
38
}
39
 
40
 
41
int main()
42
{
43
  Y y;
44
  y.f();
45
}
46
 
47
 
48
 
49
 

powered by: WebSVN 2.1.0

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