1// { dg-do run } 2// g++ 1.36.1 bug 900207_03 3 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. 9 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. 12 13// Cfront 2.0 passes this test. 14 15// keywords: implicit copy constructor, initialization 16 17 18// Check construction for a type without virtual function members. 19 20struct struct0 { 21 int data_member; 22}; 23 24struct0 struct0_gbl_object0; 25struct0 struct0_gbl_object1 (struct0_gbl_object0); // { dg-bogus "" } 26 27void struct0_test () 28{ 29 struct0 struct0_lcl_object1 (struct0_gbl_object0); // { dg-bogus "" } 30} 31 32// Check construction for a type with virtual function members. 33 34struct struct1 { 35 int data_member; 36 37 virtual void function_member (); 38}; 39 40void struct1::function_member () { } 41 42struct1 struct1_gbl_object0; 43struct1 struct1_gbl_object1 (struct1_gbl_object0); // { dg-bogus "" } 44 45void struct1_test () 46{ 47 struct1 struct1_lcl_object1 (struct1_gbl_object0); // { dg-bogus "" } 48} 49 50int main () { return 0; } 51