Merge to HEAD at tree-cleanup-merge-20041024 .
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.law / arm12.C
blobc0332d3673336957023429efc1f4440ee86b04ee
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() // { dg-error "is private" }
27   std::cout << "X::X()" << std::endl;
30 void X::f()
32   std::cout << "X::f()" << std::endl;
35 Y::Y() // { dg-error "within this context" }
37   std::cout << "Y::Y()" << std::endl;
41 int main()
43   Y y;
44   y.f();