1 // g++ 1.36.1 bug 900119_01
3 // g++ allows initializers to be included in the declaration of members
4 // of classes, structs, unions (even when -pedantic is used).
6 // This is not allowed by the C++ 2.0 Reference Manual or by Cfront 2.0.
8 // keywords: member declaration, member initialization
14 int class0_member_0 = 99; /* ERROR - */
15 static int class0_member_1 = 99; /* ERROR - */
16 int &class0_member_2 = global_int; /* ERROR - */
18 class0 () : class0_member_2 (global_int) { } /* ERROR - */
23 int struct0_member_0 = 99; /* ERROR - */
24 static int struct0_member_1 = 99; /* ERROR - */
25 int &struct0_member_2 = global_int; /* ERROR - */
27 struct0 () : struct0_member_2 (global_int) { } /* ERROR - */
30 // g++ does not allow unions to have more than one member with an initializer
33 int union0_member_0 = 99; /* ERROR - */
37 //static int union1_member_0 = 99; /* definitely illegal (9.5) */
41 int &union2_member_0 = global_int; /* ERROR - */
43 union2 () : union2_member_0 (global_int) { } /* ERROR - */
46 int main () { return 0; }