Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900205_04.C
bloba2c84fadb9e100e0c96653ba738b29e6b701fb98
1 // { dg-do assemble  }
2 // g++ 1.36.1 bug 900205_04
4 // g++ allows a class for which an implicit default X::X() constructor must
5 // be created (implicitly by the compiler) to be derived from another class
6 // which does not have its own default X::X() constructor.  This is illegal.
8 // Cfront 2.0 passes this test.
10 // keywords: default constructor, inheritance
12 // In ISO C++ 1998, such a derived class is not ill-formed, but if the
13 // implicitly-declared constructor is used, then it is implicitly
14 // defined and found to be ill-formed.
16 struct struct0 { // { dg-error "note" }
17   int data_member;
19   struct0 (int, void *);        // suppresses implicit default constructor
22 struct0::struct0 (int, void *) // { dg-error "note" }
26 struct struct0_derived_struct_0 : public struct0 { // { dg-error "" }
29 struct0_derived_struct_0 object;
31 int main () { return 0; }