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.
24 struct0 struct0_gbl_object0;
25 struct0 struct0_gbl_object1 (struct0_gbl_object0); // { dg-bogus "" }
29 struct0 struct0_lcl_object1 (struct0_gbl_object0); // { dg-bogus "" }
32 // Check construction for a type with virtual function members.
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 "" }
47 struct1 struct1_lcl_object1 (struct1_gbl_object0); // { dg-bogus "" }
50 int main () { return 0; }