2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.law / arm12.C
blobb098c22d58a58b6b64c8ee6189165e95ea95a7bd
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)
8 #include <iostream>
10 class X
12 public:
13   void f();
15 private:
16   X();
19 class Y : public X
21 public:
22   Y();
25 X::X()
26 {// { dg-error "" } .*
27   std::cout << "X::X()" << std::endl;
30 void X::f()
32   std::cout << "X::f()" << std::endl;
35 Y::Y()
36 {// { dg-error "" }  within this
37   std::cout << "Y::Y()" << std::endl;
41 int main()
43   Y y;
44   y.f();