3 enum region
{ oriental
, egyptian
, greek
, etruscan
, roman
};
5 void keepalive(bool *var
) { }
6 void keepalive_int (int *var
) { }
12 typedef region antiquities
;
13 static const bool test
= true;
14 static const int key1
= 5;
17 static antiquities value
;
20 gnu_obj_1(antiquities a
, long l
) {}
25 static int sintvar
= 4;
26 static bool svar
= true;
29 keepalive_int (&sintvar
);
34 // An object with a single constructor.
35 class single_constructor
38 single_constructor () { }
39 ~single_constructor () { }
42 const bool gnu_obj_1::test
;
43 const int gnu_obj_1::key1
;
44 long gnu_obj_1::key2
= 77;
45 gnu_obj_1::antiquities
gnu_obj_1::value
= oriental
;
50 class gnu_obj_2
: public virtual gnu_obj_1
53 static antiquities value_derived
;
56 gnu_obj_2(antiquities b
): gnu_obj_1(oriental
, 7) { }
60 typename gnu_obj_2
<T
>::antiquities gnu_obj_2
<T
>::value_derived
= etruscan
;
67 typedef region antiquities
;
68 static gnu_obj_2
<int> data
;
71 gnu_obj_3(antiquities b
) { }
75 gnu_obj_2
<int> gnu_obj_3
<T
>::data(etruscan
);
81 // instantiate templates explicitly so their static members will exist
82 template class gnu_obj_2
<int>;
83 template class gnu_obj_2
<long>;
84 template class gnu_obj_3
<long>;
88 gnu_obj_1
test1(egyptian
, 4589);
89 gnu_obj_2
<long> test2(roman
);
90 gnu_obj_3
<long> test3(greek
);
92 single_constructor test5
;
94 test4
.dummy
= test4
.elsewhere
;
97 test1
.method (); // breakpoint: constructs-done