2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900207_03.C
blob8dd5c9f8c809362e099720457ef81a4d8bbb603c
1 // { dg-do run  }
2 // g++ 1.36.1 bug 900207_03
4 // g++ fails to allow objects of class or struct types to be initialized
5 // using "constructor syntax" in cases where an implicitly generated copy
6 // constructor would be invoked for the initialization, and where there is
7 // no explicitly specified constructor associated with the type of the
8 // object being initialized.
10 // Note that the type of the error changes depending upon whether or not the
11 // type being initialized has any virtual functions associated with it.
13 // Cfront 2.0 passes this test.
15 // keywords: implicit copy constructor, initialization
18 // Check construction for a type without virtual function members.
20 struct struct0 {
21   int data_member;
24 struct0 struct0_gbl_object0;
25 struct0 struct0_gbl_object1 (struct0_gbl_object0);      // { dg-bogus "" } 
27 void struct0_test ()
29   struct0 struct0_lcl_object1 (struct0_gbl_object0);    // { dg-bogus "" } 
32 // Check construction for a type with virtual function members.
34 struct struct1 {
35   int data_member;
37   virtual void function_member ();
40 void struct1::function_member () { }
42 struct1 struct1_gbl_object0;
43 struct1 struct1_gbl_object1 (struct1_gbl_object0);      // { dg-bogus "" } 
45 void struct1_test ()
47   struct1 struct1_lcl_object1 (struct1_gbl_object0);    // { dg-bogus "" } 
50 int main () { return 0; }