1 // g++ 1.36.1 bug 900207_03
3 // g++ fails to allow objects of class or struct types to be initialized
4 // using "constructor syntax" in cases where an implicitly generated copy
5 // constructor would be invoked for the initialization, and where there is
6 // no explicitly specified constructor associated with the type of the
7 // object being initialized.
9 // Note that the type of the error changes depending upon whether or not the
10 // type being initialized has any virtual functions associated with it.
12 // Cfront 2.0 passes this test.
14 // keywords: implicit copy constructor, initialization
17 // Check construction for a type without virtual function members.
23 struct0 struct0_gbl_object0;
24 struct0 struct0_gbl_object1 (struct0_gbl_object0); // gets bogus error
28 struct0 struct0_lcl_object1 (struct0_gbl_object0); // gets bogus error
31 // Check construction for a type with virtual function members.
36 virtual void function_member ();
39 void struct1::function_member () { }
41 struct1 struct1_gbl_object0;
42 struct1 struct1_gbl_object1 (struct1_gbl_object0); // gets bogus error
46 struct1 struct1_lcl_object1 (struct1_gbl_object0); // gets bogus error
49 int main () { return 0; }