FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900207_03.C
blob187c070acb8ce76a3c5e7d6f004cc53660c3105b
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.
19 struct struct0 {
20   int data_member;
23 struct0 struct0_gbl_object0;
24 struct0 struct0_gbl_object1 (struct0_gbl_object0);      // gets bogus error
26 void struct0_test ()
28   struct0 struct0_lcl_object1 (struct0_gbl_object0);    // gets bogus error
31 // Check construction for a type with virtual function members.
33 struct struct1 {
34   int data_member;
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
44 void struct1_test ()
46   struct1 struct1_lcl_object1 (struct1_gbl_object0);    // gets bogus error
49 int main () { return 0; }