2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900428_03.C
blob722de9be662b8cbb2b9aa0a61b26fa4e78de23bf
1 // { dg-do assemble  }
2 // g++ 1.37.1 bug 900428_03
4 // g++ fails to detect cases where a constructor for a derived class invokes
5 // (either explicitly or implicitly) a private constructor for a base class.
7 // cfront 2.0 passes this test.
9 // keywords: inheritance, private, accessability, constructors
11 struct struct_0 {
12   int struct_0_data_member;
14 private:
15   struct_0 (int, int);
16 public:
17   struct_0 (int);
20 struct_0::struct_0 (int i) { }
21 struct_0::struct_0 (int, int) { } // { dg-error "" } xref from below
23 struct struct_1 : public struct_0 {
25   struct_1 ();
28 struct_1::struct_1 () : struct_0 (8,9)
29 {                               // { dg-error "" } 
32 struct struct_2 {
33   struct_0 struct_2_data_member;
35   struct_2 ();
38 // g++ catches the following error (but does so only at the line with the 
39 // closing curly brace).
41 struct_2::struct_2 () : struct_2_data_member (8,9)
42 {                               // { dg-error "" } should be up one line
45 int main () { return 0; }