1 /* { dg-do compile } */
2 extern "C"
3 {
4 typedef struct _IO_FILE FILE;
5 extern int fprintf (FILE * __restrict __stream,
6 const char *__restrict __format, ...);
7 }
8 typedef union tree_node *tree;
9 class ipa_polymorphic_call_context
10 {
11 };
12 class ipcp_value_base
13 {
14 };
15 template < typename valtype > class ipcp_value:public ipcp_value_base
16 {
17 public:valtype value;
18 ipcp_value *next;
19 };
20
21 template < typename valtype > class ipcp_lattice
22 {
23 public:ipcp_value < valtype > *values;
24 void print (FILE * f, bool dump_sources, bool dump_benefits);
25 };
26
27 class ipcp_param_lattices
28 {
29 public:ipcp_lattice < tree > itself;
30 ipcp_lattice < ipa_polymorphic_call_context > ctxlat;
31 };
print(FILE * f,bool dump_sources,bool dump_benefits)32 template < typename valtype > void ipcp_lattice < valtype >::print (FILE * f,
33 bool
34 dump_sources,
35 bool
36 dump_benefits)
37 {
38 ipcp_value < valtype > *val;
39 bool prev = false;
40 for (val = values; val; val = val->next)
41 {
42 if (dump_benefits && prev)
43 fprintf (f, " ");
44 else if (!dump_benefits && prev)
45 fprintf (f, ", ");
46 else
47 prev = true;
48 if (dump_sources)
49 fprintf (f, "]");
50 if (dump_benefits)
51 fprintf (f, "shit");
52 }
53 }
54
55 void
print_all_lattices(FILE * f,bool dump_sources,bool dump_benefits)56 print_all_lattices (FILE * f, bool dump_sources, bool dump_benefits)
57 {
58 struct ipcp_param_lattices *plats;
59 plats->ctxlat.print (f, dump_sources, dump_benefits);
60 }
61