Skip to content

Commit 7f8cada

Browse files
authored
Merge pull request #2869 from geky/callback-fix-overloads
callback - Remove problematic callback overloads
2 parents f738351 + c18e178 commit 7f8cada

File tree

4 files changed

+132
-420
lines changed

4 files changed

+132
-420
lines changed

TESTS/mbed_functional/callback/main.cpp

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -320,23 +320,23 @@ void test_dispatch0() {
320320
Verifier<T>::verify0((const Thing<T>*)&thing, &Thing<T>::const_member_func0);
321321
Verifier<T>::verify0((volatile Thing<T>*)&thing, &Thing<T>::volatile_member_func0);
322322
Verifier<T>::verify0((const volatile Thing<T>*)&thing, &Thing<T>::const_volatile_member_func0);
323-
Verifier<T>::verify0(&thing, &bound_func0<T>);
324-
Verifier<T>::verify0((const Thing<T>*)&thing, &const_bound_func0<T>);
325-
Verifier<T>::verify0((volatile Thing<T>*)&thing, &volatile_bound_func0<T>);
326-
Verifier<T>::verify0((const volatile Thing<T>*)&thing, &const_volatile_bound_func0<T>);
327-
Verifier<T>::verify0(&thing, &void_func0<T>);
328-
Verifier<T>::verify0((const Thing<T>*)&thing, &const_void_func0<T>);
329-
Verifier<T>::verify0((volatile Thing<T>*)&thing, &volatile_void_func0<T>);
330-
Verifier<T>::verify0((const volatile Thing<T>*)&thing, &const_volatile_void_func0<T>);
323+
Verifier<T>::verify0(&bound_func0<T>, &thing);
324+
Verifier<T>::verify0(&const_bound_func0<T>, (const Thing<T>*)&thing);
325+
Verifier<T>::verify0(&volatile_bound_func0<T>, (volatile Thing<T>*)&thing);
326+
Verifier<T>::verify0(&const_volatile_bound_func0<T>, (const volatile Thing<T>*)&thing);
327+
Verifier<T>::verify0(&void_func0<T>, &thing);
328+
Verifier<T>::verify0(&const_void_func0<T>, (const Thing<T>*)&thing);
329+
Verifier<T>::verify0(&volatile_void_func0<T>, (volatile Thing<T>*)&thing);
330+
Verifier<T>::verify0(&const_volatile_void_func0<T>, (const volatile Thing<T>*)&thing);
331331
Verifier<T>::verify0(callback(static_func0<T>));
332332

333333
Callback<T()> cb(static_func0);
334334
Verifier<T>::verify0(cb);
335335
cb = static_func0;
336336
Verifier<T>::verify0(cb);
337-
cb.attach(&thing, &bound_func0<T>);
337+
cb.attach(&bound_func0<T>, &thing);
338338
Verifier<T>::verify0(&cb, &Callback<T()>::call);
339-
Verifier<T>::verify0((void*)&cb, &Callback<T()>::thunk);
339+
Verifier<T>::verify0(&Callback<T()>::thunk, (void*)&cb);
340340
}
341341

342342
template <typename T>
@@ -347,23 +347,23 @@ void test_dispatch1() {
347347
Verifier<T>::verify1((const Thing<T>*)&thing, &Thing<T>::const_member_func1);
348348
Verifier<T>::verify1((volatile Thing<T>*)&thing, &Thing<T>::volatile_member_func1);
349349
Verifier<T>::verify1((const volatile Thing<T>*)&thing, &Thing<T>::const_volatile_member_func1);
350-
Verifier<T>::verify1(&thing, &bound_func1<T>);
351-
Verifier<T>::verify1((const Thing<T>*)&thing, &const_bound_func1<T>);
352-
Verifier<T>::verify1((volatile Thing<T>*)&thing, &volatile_bound_func1<T>);
353-
Verifier<T>::verify1((const volatile Thing<T>*)&thing, &const_volatile_bound_func1<T>);
354-
Verifier<T>::verify1(&thing, &void_func1<T>);
355-
Verifier<T>::verify1((const Thing<T>*)&thing, &const_void_func1<T>);
356-
Verifier<T>::verify1((volatile Thing<T>*)&thing, &volatile_void_func1<T>);
357-
Verifier<T>::verify1((const volatile Thing<T>*)&thing, &const_volatile_void_func1<T>);
350+
Verifier<T>::verify1(&bound_func1<T>, &thing);
351+
Verifier<T>::verify1(&const_bound_func1<T>, (const Thing<T>*)&thing);
352+
Verifier<T>::verify1(&volatile_bound_func1<T>, (volatile Thing<T>*)&thing);
353+
Verifier<T>::verify1(&const_volatile_bound_func1<T>, (const volatile Thing<T>*)&thing);
354+
Verifier<T>::verify1(&void_func1<T>, &thing);
355+
Verifier<T>::verify1(&const_void_func1<T>, (const Thing<T>*)&thing);
356+
Verifier<T>::verify1(&volatile_void_func1<T>, (volatile Thing<T>*)&thing);
357+
Verifier<T>::verify1(&const_volatile_void_func1<T>, (const volatile Thing<T>*)&thing);
358358
Verifier<T>::verify1(callback(static_func1<T>));
359359

360360
Callback<T(T)> cb(static_func1);
361361
Verifier<T>::verify1(cb);
362362
cb = static_func1;
363363
Verifier<T>::verify1(cb);
364-
cb.attach(&thing, &bound_func1<T>);
364+
cb.attach(&bound_func1<T>, &thing);
365365
Verifier<T>::verify1(&cb, &Callback<T(T)>::call);
366-
Verifier<T>::verify1((void*)&cb, &Callback<T(T)>::thunk);
366+
Verifier<T>::verify1(&Callback<T(T)>::thunk, (void*)&cb);
367367
}
368368

369369
template <typename T>
@@ -374,23 +374,23 @@ void test_dispatch2() {
374374
Verifier<T>::verify2((const Thing<T>*)&thing, &Thing<T>::const_member_func2);
375375
Verifier<T>::verify2((volatile Thing<T>*)&thing, &Thing<T>::volatile_member_func2);
376376
Verifier<T>::verify2((const volatile Thing<T>*)&thing, &Thing<T>::const_volatile_member_func2);
377-
Verifier<T>::verify2(&thing, &bound_func2<T>);
378-
Verifier<T>::verify2((const Thing<T>*)&thing, &const_bound_func2<T>);
379-
Verifier<T>::verify2((volatile Thing<T>*)&thing, &volatile_bound_func2<T>);
380-
Verifier<T>::verify2((const volatile Thing<T>*)&thing, &const_volatile_bound_func2<T>);
381-
Verifier<T>::verify2(&thing, &void_func2<T>);
382-
Verifier<T>::verify2((const Thing<T>*)&thing, &const_void_func2<T>);
383-
Verifier<T>::verify2((volatile Thing<T>*)&thing, &volatile_void_func2<T>);
384-
Verifier<T>::verify2((const volatile Thing<T>*)&thing, &const_volatile_void_func2<T>);
377+
Verifier<T>::verify2(&bound_func2<T>, &thing);
378+
Verifier<T>::verify2(&const_bound_func2<T>, (const Thing<T>*)&thing);
379+
Verifier<T>::verify2(&volatile_bound_func2<T>, (volatile Thing<T>*)&thing);
380+
Verifier<T>::verify2(&const_volatile_bound_func2<T>, (const volatile Thing<T>*)&thing);
381+
Verifier<T>::verify2(&void_func2<T>, &thing);
382+
Verifier<T>::verify2(&const_void_func2<T>, (const Thing<T>*)&thing);
383+
Verifier<T>::verify2(&volatile_void_func2<T>, (volatile Thing<T>*)&thing);
384+
Verifier<T>::verify2(&const_volatile_void_func2<T>, (const volatile Thing<T>*)&thing);
385385
Verifier<T>::verify2(callback(static_func2<T>));
386386

387387
Callback<T(T, T)> cb(static_func2);
388388
Verifier<T>::verify2(cb);
389389
cb = static_func2;
390390
Verifier<T>::verify2(cb);
391-
cb.attach(&thing, &bound_func2<T>);
391+
cb.attach(&bound_func2<T>, &thing);
392392
Verifier<T>::verify2(&cb, &Callback<T(T, T)>::call);
393-
Verifier<T>::verify2((void*)&cb, &Callback<T(T, T)>::thunk);
393+
Verifier<T>::verify2(&Callback<T(T, T)>::thunk, (void*)&cb);
394394
}
395395

396396
template <typename T>
@@ -401,23 +401,23 @@ void test_dispatch3() {
401401
Verifier<T>::verify3((const Thing<T>*)&thing, &Thing<T>::const_member_func3);
402402
Verifier<T>::verify3((volatile Thing<T>*)&thing, &Thing<T>::volatile_member_func3);
403403
Verifier<T>::verify3((const volatile Thing<T>*)&thing, &Thing<T>::const_volatile_member_func3);
404-
Verifier<T>::verify3(&thing, &bound_func3<T>);
405-
Verifier<T>::verify3((const Thing<T>*)&thing, &const_bound_func3<T>);
406-
Verifier<T>::verify3((volatile Thing<T>*)&thing, &volatile_bound_func3<T>);
407-
Verifier<T>::verify3((const volatile Thing<T>*)&thing, &const_volatile_bound_func3<T>);
408-
Verifier<T>::verify3(&thing, &void_func3<T>);
409-
Verifier<T>::verify3((const Thing<T>*)&thing, &const_void_func3<T>);
410-
Verifier<T>::verify3((volatile Thing<T>*)&thing, &volatile_void_func3<T>);
411-
Verifier<T>::verify3((const volatile Thing<T>*)&thing, &const_volatile_void_func3<T>);
404+
Verifier<T>::verify3(&bound_func3<T>, &thing);
405+
Verifier<T>::verify3(&const_bound_func3<T>, (const Thing<T>*)&thing);
406+
Verifier<T>::verify3(&volatile_bound_func3<T>, (volatile Thing<T>*)&thing);
407+
Verifier<T>::verify3(&const_volatile_bound_func3<T>, (const volatile Thing<T>*)&thing);
408+
Verifier<T>::verify3(&void_func3<T>, &thing);
409+
Verifier<T>::verify3(&const_void_func3<T>, (const Thing<T>*)&thing);
410+
Verifier<T>::verify3(&volatile_void_func3<T>, (volatile Thing<T>*)&thing);
411+
Verifier<T>::verify3(&const_volatile_void_func3<T>, (const volatile Thing<T>*)&thing);
412412
Verifier<T>::verify3(callback(static_func3<T>));
413413

414414
Callback<T(T, T, T)> cb(static_func3);
415415
Verifier<T>::verify3(cb);
416416
cb = static_func3;
417417
Verifier<T>::verify3(cb);
418-
cb.attach(&thing, &bound_func3<T>);
418+
cb.attach(&bound_func3<T>, &thing);
419419
Verifier<T>::verify3(&cb, &Callback<T(T, T, T)>::call);
420-
Verifier<T>::verify3((void*)&cb, &Callback<T(T, T, T)>::thunk);
420+
Verifier<T>::verify3(&Callback<T(T, T, T)>::thunk, (void*)&cb);
421421
}
422422

423423
template <typename T>
@@ -428,23 +428,23 @@ void test_dispatch4() {
428428
Verifier<T>::verify4((const Thing<T>*)&thing, &Thing<T>::const_member_func4);
429429
Verifier<T>::verify4((volatile Thing<T>*)&thing, &Thing<T>::volatile_member_func4);
430430
Verifier<T>::verify4((const volatile Thing<T>*)&thing, &Thing<T>::const_volatile_member_func4);
431-
Verifier<T>::verify4(&thing, &bound_func4<T>);
432-
Verifier<T>::verify4((const Thing<T>*)&thing, &const_bound_func4<T>);
433-
Verifier<T>::verify4((volatile Thing<T>*)&thing, &volatile_bound_func4<T>);
434-
Verifier<T>::verify4((const volatile Thing<T>*)&thing, &const_volatile_bound_func4<T>);
435-
Verifier<T>::verify4(&thing, &void_func4<T>);
436-
Verifier<T>::verify4((const Thing<T>*)&thing, &const_void_func4<T>);
437-
Verifier<T>::verify4((volatile Thing<T>*)&thing, &volatile_void_func4<T>);
438-
Verifier<T>::verify4((const volatile Thing<T>*)&thing, &const_volatile_void_func4<T>);
431+
Verifier<T>::verify4(&bound_func4<T>, &thing);
432+
Verifier<T>::verify4(&const_bound_func4<T>, (const Thing<T>*)&thing);
433+
Verifier<T>::verify4(&volatile_bound_func4<T>, (volatile Thing<T>*)&thing);
434+
Verifier<T>::verify4(&const_volatile_bound_func4<T>, (const volatile Thing<T>*)&thing);
435+
Verifier<T>::verify4(&void_func4<T>, &thing);
436+
Verifier<T>::verify4(&const_void_func4<T>, (const Thing<T>*)&thing);
437+
Verifier<T>::verify4(&volatile_void_func4<T>, (volatile Thing<T>*)&thing);
438+
Verifier<T>::verify4(&const_volatile_void_func4<T>, (const volatile Thing<T>*)&thing);
439439
Verifier<T>::verify4(callback(static_func4<T>));
440440

441441
Callback<T(T, T, T, T)> cb(static_func4);
442442
Verifier<T>::verify4(cb);
443443
cb = static_func4;
444444
Verifier<T>::verify4(cb);
445-
cb.attach(&thing, &bound_func4<T>);
445+
cb.attach(&bound_func4<T>, &thing);
446446
Verifier<T>::verify4(&cb, &Callback<T(T, T, T, T)>::call);
447-
Verifier<T>::verify4((void*)&cb, &Callback<T(T, T, T, T)>::thunk);
447+
Verifier<T>::verify4(&Callback<T(T, T, T, T)>::thunk, (void*)&cb);
448448
}
449449

450450
template <typename T>
@@ -455,23 +455,23 @@ void test_dispatch5() {
455455
Verifier<T>::verify5((const Thing<T>*)&thing, &Thing<T>::const_member_func5);
456456
Verifier<T>::verify5((volatile Thing<T>*)&thing, &Thing<T>::volatile_member_func5);
457457
Verifier<T>::verify5((const volatile Thing<T>*)&thing, &Thing<T>::const_volatile_member_func5);
458-
Verifier<T>::verify5(&thing, &bound_func5<T>);
459-
Verifier<T>::verify5((const Thing<T>*)&thing, &const_bound_func5<T>);
460-
Verifier<T>::verify5((volatile Thing<T>*)&thing, &volatile_bound_func5<T>);
461-
Verifier<T>::verify5((const volatile Thing<T>*)&thing, &const_volatile_bound_func5<T>);
462-
Verifier<T>::verify5(&thing, &void_func5<T>);
463-
Verifier<T>::verify5((const Thing<T>*)&thing, &const_void_func5<T>);
464-
Verifier<T>::verify5((volatile Thing<T>*)&thing, &volatile_void_func5<T>);
465-
Verifier<T>::verify5((const volatile Thing<T>*)&thing, &const_volatile_void_func5<T>);
458+
Verifier<T>::verify5(&bound_func5<T>, &thing);
459+
Verifier<T>::verify5(&const_bound_func5<T>, (const Thing<T>*)&thing);
460+
Verifier<T>::verify5(&volatile_bound_func5<T>, (volatile Thing<T>*)&thing);
461+
Verifier<T>::verify5(&const_volatile_bound_func5<T>, (const volatile Thing<T>*)&thing);
462+
Verifier<T>::verify5(&void_func5<T>, &thing);
463+
Verifier<T>::verify5(&const_void_func5<T>, (const Thing<T>*)&thing);
464+
Verifier<T>::verify5(&volatile_void_func5<T>, (volatile Thing<T>*)&thing);
465+
Verifier<T>::verify5(&const_volatile_void_func5<T>, (const volatile Thing<T>*)&thing);
466466
Verifier<T>::verify5(callback(static_func5<T>));
467467

468468
Callback<T(T, T, T, T, T)> cb(static_func5);
469469
Verifier<T>::verify5(cb);
470470
cb = static_func5;
471471
Verifier<T>::verify5(cb);
472-
cb.attach(&thing, &bound_func5<T>);
472+
cb.attach(&bound_func5<T>, &thing);
473473
Verifier<T>::verify5(&cb, &Callback<T(T, T, T, T, T)>::call);
474-
Verifier<T>::verify5((void*)&cb, &Callback<T(T, T, T, T, T)>::thunk);
474+
Verifier<T>::verify5(&Callback<T(T, T, T, T, T)>::thunk, (void*)&cb);
475475
}
476476

477477

TESTS/mbed_functional/callback_big/main.cpp

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -198,19 +198,19 @@ void test_dispatch0() {
198198
Verifier<T>::verify0((const Thing<T>*)&thing, &Thing<T>::const_member_func0);
199199
Verifier<T>::verify0((volatile Thing<T>*)&thing, &Thing<T>::volatile_member_func0);
200200
Verifier<T>::verify0((const volatile Thing<T>*)&thing, &Thing<T>::const_volatile_member_func0);
201-
Verifier<T>::verify0(&thing, &bound_func0<T>);
202-
Verifier<T>::verify0((const Thing<T>*)&thing, &const_func0<T>);
203-
Verifier<T>::verify0((volatile Thing<T>*)&thing, &volatile_func0<T>);
204-
Verifier<T>::verify0((const volatile Thing<T>*)&thing, &const_volatile_func0<T>);
201+
Verifier<T>::verify0(&bound_func0<T>, &thing);
202+
Verifier<T>::verify0(&const_func0<T>, (const Thing<T>*)&thing);
203+
Verifier<T>::verify0(&volatile_func0<T>, (volatile Thing<T>*)&thing);
204+
Verifier<T>::verify0(&const_volatile_func0<T>, (const volatile Thing<T>*)&thing);
205205
Verifier<T>::verify0(callback(static_func0<T>));
206206

207207
Callback<T()> cb(static_func0);
208208
Verifier<T>::verify0(cb);
209209
cb = static_func0;
210210
Verifier<T>::verify0(cb);
211-
cb.attach(&thing, &bound_func0<T>);
211+
cb.attach(&bound_func0<T>, &thing);
212212
Verifier<T>::verify0(&cb, &Callback<T()>::call);
213-
Verifier<T>::verify0((void*)&cb, &Callback<T()>::thunk);
213+
Verifier<T>::verify0(&Callback<T()>::thunk, (void*)&cb);
214214
}
215215

216216
template <typename T>
@@ -221,19 +221,19 @@ void test_dispatch1() {
221221
Verifier<T>::verify1((const Thing<T>*)&thing, &Thing<T>::const_member_func1);
222222
Verifier<T>::verify1((volatile Thing<T>*)&thing, &Thing<T>::volatile_member_func1);
223223
Verifier<T>::verify1((const volatile Thing<T>*)&thing, &Thing<T>::const_volatile_member_func1);
224-
Verifier<T>::verify1(&thing, &bound_func1<T>);
225-
Verifier<T>::verify1((const Thing<T>*)&thing, &const_func1<T>);
226-
Verifier<T>::verify1((volatile Thing<T>*)&thing, &volatile_func1<T>);
227-
Verifier<T>::verify1((const volatile Thing<T>*)&thing, &const_volatile_func1<T>);
224+
Verifier<T>::verify1(&bound_func1<T>, &thing);
225+
Verifier<T>::verify1(&const_func1<T>, (const Thing<T>*)&thing);
226+
Verifier<T>::verify1(&volatile_func1<T>, (volatile Thing<T>*)&thing);
227+
Verifier<T>::verify1(&const_volatile_func1<T>, (const volatile Thing<T>*)&thing);
228228
Verifier<T>::verify1(callback(static_func1<T>));
229229

230230
Callback<T(T)> cb(static_func1);
231231
Verifier<T>::verify1(cb);
232232
cb = static_func1;
233233
Verifier<T>::verify1(cb);
234-
cb.attach(&thing, &bound_func1<T>);
234+
cb.attach(&bound_func1<T>, &thing);
235235
Verifier<T>::verify1(&cb, &Callback<T(T)>::call);
236-
Verifier<T>::verify1((void*)&cb, &Callback<T(T)>::thunk);
236+
Verifier<T>::verify1(&Callback<T(T)>::thunk, (void*)&cb);
237237
}
238238

239239
template <typename T>
@@ -244,19 +244,19 @@ void test_dispatch2() {
244244
Verifier<T>::verify2((const Thing<T>*)&thing, &Thing<T>::const_member_func2);
245245
Verifier<T>::verify2((volatile Thing<T>*)&thing, &Thing<T>::volatile_member_func2);
246246
Verifier<T>::verify2((const volatile Thing<T>*)&thing, &Thing<T>::const_volatile_member_func2);
247-
Verifier<T>::verify2(&thing, &bound_func2<T>);
248-
Verifier<T>::verify2((const Thing<T>*)&thing, &const_func2<T>);
249-
Verifier<T>::verify2((volatile Thing<T>*)&thing, &volatile_func2<T>);
250-
Verifier<T>::verify2((const volatile Thing<T>*)&thing, &const_volatile_func2<T>);
247+
Verifier<T>::verify2(&bound_func2<T>, &thing);
248+
Verifier<T>::verify2(&const_func2<T>, (const Thing<T>*)&thing);
249+
Verifier<T>::verify2(&volatile_func2<T>, (volatile Thing<T>*)&thing);
250+
Verifier<T>::verify2(&const_volatile_func2<T>, (const volatile Thing<T>*)&thing);
251251
Verifier<T>::verify2(callback(static_func2<T>));
252252

253253
Callback<T(T, T)> cb(static_func2);
254254
Verifier<T>::verify2(cb);
255255
cb = static_func2;
256256
Verifier<T>::verify2(cb);
257-
cb.attach(&thing, &bound_func2<T>);
257+
cb.attach(&bound_func2<T>, &thing);
258258
Verifier<T>::verify2(&cb, &Callback<T(T, T)>::call);
259-
Verifier<T>::verify2((void*)&cb, &Callback<T(T, T)>::thunk);
259+
Verifier<T>::verify2(&Callback<T(T, T)>::thunk, (void*)&cb);
260260
}
261261

262262
template <typename T>
@@ -267,19 +267,19 @@ void test_dispatch3() {
267267
Verifier<T>::verify3((const Thing<T>*)&thing, &Thing<T>::const_member_func3);
268268
Verifier<T>::verify3((volatile Thing<T>*)&thing, &Thing<T>::volatile_member_func3);
269269
Verifier<T>::verify3((const volatile Thing<T>*)&thing, &Thing<T>::const_volatile_member_func3);
270-
Verifier<T>::verify3(&thing, &bound_func3<T>);
271-
Verifier<T>::verify3((const Thing<T>*)&thing, &const_func3<T>);
272-
Verifier<T>::verify3((volatile Thing<T>*)&thing, &volatile_func3<T>);
273-
Verifier<T>::verify3((const volatile Thing<T>*)&thing, &const_volatile_func3<T>);
270+
Verifier<T>::verify3(&bound_func3<T>, &thing);
271+
Verifier<T>::verify3(&const_func3<T>, (const Thing<T>*)&thing);
272+
Verifier<T>::verify3(&volatile_func3<T>, (volatile Thing<T>*)&thing);
273+
Verifier<T>::verify3(&const_volatile_func3<T>, (const volatile Thing<T>*)&thing);
274274
Verifier<T>::verify3(callback(static_func3<T>));
275275

276276
Callback<T(T, T, T)> cb(static_func3);
277277
Verifier<T>::verify3(cb);
278278
cb = static_func3;
279279
Verifier<T>::verify3(cb);
280-
cb.attach(&thing, &bound_func3<T>);
280+
cb.attach(&bound_func3<T>, &thing);
281281
Verifier<T>::verify3(&cb, &Callback<T(T, T, T)>::call);
282-
Verifier<T>::verify3((void*)&cb, &Callback<T(T, T, T)>::thunk);
282+
Verifier<T>::verify3(&Callback<T(T, T, T)>::thunk, (void*)&cb);
283283
}
284284

285285
template <typename T>
@@ -290,19 +290,19 @@ void test_dispatch4() {
290290
Verifier<T>::verify4((const Thing<T>*)&thing, &Thing<T>::const_member_func4);
291291
Verifier<T>::verify4((volatile Thing<T>*)&thing, &Thing<T>::volatile_member_func4);
292292
Verifier<T>::verify4((const volatile Thing<T>*)&thing, &Thing<T>::const_volatile_member_func4);
293-
Verifier<T>::verify4(&thing, &bound_func4<T>);
294-
Verifier<T>::verify4((const Thing<T>*)&thing, &const_func4<T>);
295-
Verifier<T>::verify4((volatile Thing<T>*)&thing, &volatile_func4<T>);
296-
Verifier<T>::verify4((const volatile Thing<T>*)&thing, &const_volatile_func4<T>);
293+
Verifier<T>::verify4(&bound_func4<T>, &thing);
294+
Verifier<T>::verify4(&const_func4<T>, (const Thing<T>*)&thing);
295+
Verifier<T>::verify4(&volatile_func4<T>, (volatile Thing<T>*)&thing);
296+
Verifier<T>::verify4(&const_volatile_func4<T>, (const volatile Thing<T>*)&thing);
297297
Verifier<T>::verify4(callback(static_func4<T>));
298298

299299
Callback<T(T, T, T, T)> cb(static_func4);
300300
Verifier<T>::verify4(cb);
301301
cb = static_func4;
302302
Verifier<T>::verify4(cb);
303-
cb.attach(&thing, &bound_func4<T>);
303+
cb.attach(&bound_func4<T>, &thing);
304304
Verifier<T>::verify4(&cb, &Callback<T(T, T, T, T)>::call);
305-
Verifier<T>::verify4((void*)&cb, &Callback<T(T, T, T, T)>::thunk);
305+
Verifier<T>::verify4(&Callback<T(T, T, T, T)>::thunk, (void*)&cb);
306306
}
307307

308308
template <typename T>
@@ -313,19 +313,19 @@ void test_dispatch5() {
313313
Verifier<T>::verify5((const Thing<T>*)&thing, &Thing<T>::const_member_func5);
314314
Verifier<T>::verify5((volatile Thing<T>*)&thing, &Thing<T>::volatile_member_func5);
315315
Verifier<T>::verify5((const volatile Thing<T>*)&thing, &Thing<T>::const_volatile_member_func5);
316-
Verifier<T>::verify5(&thing, &bound_func5<T>);
317-
Verifier<T>::verify5((const Thing<T>*)&thing, &const_func5<T>);
318-
Verifier<T>::verify5((volatile Thing<T>*)&thing, &volatile_func5<T>);
319-
Verifier<T>::verify5((const volatile Thing<T>*)&thing, &const_volatile_func5<T>);
316+
Verifier<T>::verify5(&bound_func5<T>, &thing);
317+
Verifier<T>::verify5(&const_func5<T>, (const Thing<T>*)&thing);
318+
Verifier<T>::verify5(&volatile_func5<T>, (volatile Thing<T>*)&thing);
319+
Verifier<T>::verify5(&const_volatile_func5<T>, (const volatile Thing<T>*)&thing);
320320
Verifier<T>::verify5(callback(static_func5<T>));
321321

322322
Callback<T(T, T, T, T, T)> cb(static_func5);
323323
Verifier<T>::verify5(cb);
324324
cb = static_func5;
325325
Verifier<T>::verify5(cb);
326-
cb.attach(&thing, &bound_func5<T>);
326+
cb.attach(&bound_func5<T>, &thing);
327327
Verifier<T>::verify5(&cb, &Callback<T(T, T, T, T, T)>::call);
328-
Verifier<T>::verify5((void*)&cb, &Callback<T(T, T, T, T, T)>::thunk);
328+
Verifier<T>::verify5(&Callback<T(T, T, T, T, T)>::thunk, (void*)&cb);
329329
}
330330

331331

0 commit comments

Comments
 (0)