OSDN Git Service

Formatting fixes.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.law / arm12.C
1 // { 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 <iostream>
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()
26 {// { dg-error "" } .*
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()
36 {// { dg-error "" }  within this
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