1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
/* { dg-do compile } */ /* { dg-options "-g" } */ template <class T> static inline bool Dispatch (T* obj, void (T::*func) ()) { (obj->*func) (); } class C { bool f (int); void g (); }; bool C::f (int n) { bool b; switch (n) { case 0: b = Dispatch (this, &C::g); case 1: b = Dispatch (this, &C::g); } } void C::g () { for (;;) { } }