6 foo (int, const char *);
10 void operator * (foo
&);
11 void operator % (foo
&);
12 void operator - (foo
&);
13 void operator >> (foo
&);
14 void operator != (foo
&);
15 void operator > (foo
&);
16 void operator >= (foo
&);
17 void operator | (foo
&);
18 void operator && (foo
&);
19 void operator ! (void);
20 void operator ++ (int);
21 void operator = (foo
&);
22 void operator += (foo
&);
23 void operator *= (foo
&);
24 void operator %= (foo
&);
25 void operator >>= (foo
&);
26 void operator |= (foo
&);
27 void operator , (foo
&);
28 void operator / (foo
&);
29 void operator + (foo
&);
30 void operator << (foo
&);
31 void operator == (foo
&);
32 void operator < (foo
&);
33 void operator <= (foo
&);
34 void operator & (foo
&);
35 void operator ^ (foo
&);
36 void operator || (foo
&);
37 void operator ~ (void);
38 void operator -- (int);
39 foo
* operator -> (void);
40 void operator -= (foo
&);
41 void operator /= (foo
&);
42 void operator <<= (foo
&);
43 void operator &= (foo
&);
44 void operator ^= (foo
&);
45 void operator ->* (foo
&);
46 void operator [] (foo
&);
47 void operator () (foo
&);
48 void* operator new (size_t) throw ();
49 void* operator new[] (size_t) throw ();
50 void operator delete (void *);
51 void operator delete[] (void *);
53 /**/ operator char* ();
55 int foofunc (int); // forced to have int return type, which is required
56 int foofunc (int, signed char *); // forced to have int return type, which is required
67 foo::foo (int i
) { ifoo
= i
;}
68 foo::foo (int i
, const char *ccp
) { ifoo
= i
; ccpfoo
= ccp
; }
69 foo::foo (foo
& afoo
) { afoo
.ifoo
= 0; }
72 void foo::operator * (foo
& afoo
) { afoo
.ifoo
= 0; }
73 void foo::operator % (foo
& afoo
) { afoo
.ifoo
= 0; }
74 void foo::operator - (foo
& afoo
) { afoo
.ifoo
= 0; }
75 void foo::operator >> (foo
& afoo
) { afoo
.ifoo
= 0; }
76 void foo::operator != (foo
& afoo
) { afoo
.ifoo
= 0; }
77 void foo::operator > (foo
& afoo
) { afoo
.ifoo
= 0; }
78 void foo::operator >= (foo
& afoo
) { afoo
.ifoo
= 0; }
79 void foo::operator | (foo
& afoo
) { afoo
.ifoo
= 0; }
80 void foo::operator && (foo
& afoo
) { afoo
.ifoo
= 0; }
81 void foo::operator ! (void) {}
82 void foo::operator ++ (int ival
) { ival
= 0; }
83 void foo::operator = (foo
& afoo
) { afoo
.ifoo
= 0; }
84 void foo::operator += (foo
& afoo
) { afoo
.ifoo
= 0; }
85 void foo::operator *= (foo
& afoo
) { afoo
.ifoo
= 0; }
86 void foo::operator %= (foo
& afoo
) { afoo
.ifoo
= 0; }
87 void foo::operator >>= (foo
& afoo
) { afoo
.ifoo
= 0; }
88 void foo::operator |= (foo
& afoo
) { afoo
.ifoo
= 0; }
89 void foo::operator , (foo
& afoo
) { afoo
.ifoo
= 0; }
90 void foo::operator / (foo
& afoo
) { afoo
.ifoo
= 0; }
91 void foo::operator + (foo
& afoo
) { afoo
.ifoo
= 0; }
92 void foo::operator << (foo
& afoo
) { afoo
.ifoo
= 0; }
93 void foo::operator == (foo
& afoo
) { afoo
.ifoo
= 0; }
94 void foo::operator < (foo
& afoo
) { afoo
.ifoo
= 0; }
95 void foo::operator <= (foo
& afoo
) { afoo
.ifoo
= 0; }
96 void foo::operator & (foo
& afoo
) { afoo
.ifoo
= 0; }
97 void foo::operator ^ (foo
& afoo
) { afoo
.ifoo
= 0; }
98 void foo::operator || (foo
& afoo
) { afoo
.ifoo
= 0; }
99 void foo::operator ~ (void) {}
100 void foo::operator -- (int ival
) { ival
= 0; }
101 foo
* foo::operator -> (void) {return this;}
102 void foo::operator -= (foo
& afoo
) { afoo
.ifoo
= 0; }
103 void foo::operator /= (foo
& afoo
) { afoo
.ifoo
= 0; }
104 void foo::operator <<= (foo
& afoo
) { afoo
.ifoo
= 0; }
105 void foo::operator &= (foo
& afoo
) { afoo
.ifoo
= 0; }
106 void foo::operator ^= (foo
& afoo
) { afoo
.ifoo
= 0; }
107 void foo::operator ->* (foo
& afoo
) { afoo
.ifoo
= 0; }
108 void foo::operator [] (foo
& afoo
) { afoo
.ifoo
= 0; }
109 void foo::operator () (foo
& afoo
) { afoo
.ifoo
= 0; }
110 void* foo::operator new (size_t ival
) throw () { ival
= 0; return 0; }
111 void* foo::operator new[] (size_t ival
) throw () { ival
= 0; return 0; }
112 void foo::operator delete (void *ptr
) { ptr
= 0; }
113 void foo::operator delete[] (void *ptr
) { ptr
= 0; }
114 /**/ foo::operator int () { return 0; }
115 /**/ foo::operator char* () { return 0; }
117 /* Some functions to test overloading by varying one argument type. */
119 void overload1arg (void) { }
120 void overload1arg (char arg
) { arg
= 0; }
121 void overload1arg (signed char arg
) { arg
= 0; }
122 void overload1arg (unsigned char arg
) { arg
= 0; }
123 void overload1arg (short arg
) { arg
= 0; }
124 void overload1arg (unsigned short arg
) { arg
= 0; }
125 void overload1arg (int arg
) { arg
= 0; }
126 void overload1arg (unsigned int arg
) { arg
= 0; }
127 void overload1arg (long arg
) { arg
= 0; }
128 void overload1arg (unsigned long arg
) { arg
= 0; }
129 void overload1arg (float arg
) { arg
= 0; }
130 void overload1arg (double arg
) { arg
= 0; }
132 /* Some functions to test overloading by varying argument count. */
134 void overloadargs (int a1
) { a1
= 0; }
135 void overloadargs (int a1
, int a2
) { a1
= a2
= 0; }
136 void overloadargs (int a1
, int a2
, int a3
) { a1
= a2
= a3
= 0; }
137 void overloadargs (int a1
, int a2
, int a3
, int a4
)
138 { a1
= a2
= a3
= a4
= 0; }
139 void overloadargs (int a1
, int a2
, int a3
, int a4
, int a5
)
140 { a1
= a2
= a3
= a4
= a5
= 0; }
141 void overloadargs (int a1
, int a2
, int a3
, int a4
, int a5
, int a6
)
142 { a1
= a2
= a3
= a4
= a5
= a6
= 0; }
143 void overloadargs (int a1
, int a2
, int a3
, int a4
, int a5
, int a6
, int a7
)
144 { a1
= a2
= a3
= a4
= a5
= a6
= a7
= 0; }
145 void overloadargs (int a1
, int a2
, int a3
, int a4
, int a5
, int a6
, int a7
,
147 { a1
= a2
= a3
= a4
= a5
= a6
= a7
= a8
= 0; }
148 void overloadargs (int a1
, int a2
, int a3
, int a4
, int a5
, int a6
, int a7
,
150 { a1
= a2
= a3
= a4
= a5
= a6
= a7
= a8
= a9
= 0; }
151 void overloadargs (int a1
, int a2
, int a3
, int a4
, int a5
, int a6
, int a7
,
152 int a8
, int a9
, int a10
)
153 { a1
= a2
= a3
= a4
= a5
= a6
= a7
= a8
= a9
=
155 void overloadargs (int a1
, int a2
, int a3
, int a4
, int a5
, int a6
, int a7
,
156 int a8
, int a9
, int a10
, int a11
)
157 { a1
= a2
= a3
= a4
= a5
= a6
= a7
= a8
= a9
=
160 /* Some hairy function definitions.
161 Use typedefs to help maintain sanity. */
163 typedef int (*PFPc_i
)(char *);
164 typedef short (*PFPl_s
)(long *);
165 typedef short (*PFPc_s
)(char *);
166 typedef int (*PFl_i
)(long);
167 typedef PFl_i (*PFPc_PFl_i
)(char *);
168 typedef PFl_i (*PFPi_PFl_i
)(int *);
169 typedef PFl_i (*PFPFPc_i_PFl_i
)(PFPc_i
);
170 typedef PFl_i (*PFs_PFl_i
)(short);
171 typedef int (*PFPFPl_s_i
)(PFPl_s
);
172 typedef int (*PFPFPc_s_i
)(PFPc_s
);
174 PFs_PFl_i
hairyfunc1 (int arg
) { arg
= 0; return 0; }
175 int hairyfunc2 (PFPc_i arg
) { arg
= 0; return 0; }
176 int hairyfunc3 (PFPFPl_s_i arg
) { arg
= 0; return 0; }
177 int hairyfunc4 (PFPFPc_s_i arg
) { arg
= 0; return 0; }
178 int hairyfunc5 (PFPc_PFl_i arg
) { arg
= 0; return 0; }
179 int hairyfunc6 (PFPi_PFl_i arg
) { arg
= 0; return 0; }
180 int hairyfunc7 (PFPFPc_i_PFl_i arg
) { arg
= 0; return 0; }
182 /* gdb has two demanglers (one for g++ 2.95, one for g++ 3).
183 These marker functions help me figure out which demangler is in use. */
185 char * dm_type_char_star (char * p
) { return p
; }
186 int dm_type_foo_ref (foo
& foo
) { return foo
.ifoo
; }
187 int * dm_type_int_star (int * p
) { return p
; }
188 long * dm_type_long_star (long * p
) { return p
; }
189 int dm_type_short (short i
) { return i
; }
190 int dm_type_long (long i
) { return i
; }
191 int dm_type_unsigned_int (unsigned int i
) { return i
; }
192 int dm_type_unsigned_short (unsigned short i
) { return i
; }
193 int dm_type_unsigned_long (unsigned long i
) { return i
; }
194 int dm_type_void (void) { return 0; }
195 void * dm_type_void_star (void * p
) { return p
; }
197 int dm_type_typedef (myint i
) { return i
; }