/* { dg-do run } */ #define INLINE inline __attribute__((always_inline)) extern "C" void abort (void); template struct Foo { inline bool isFalse() { return false; } template void f1() {} template INLINE void f2() { f1(); } template void f3() { f2(); } template INLINE void f4() { f3(); } int exec2(); void execute(); inline void unused(); }; template inline void Foo::unused() { f4(); } static int counter = 0; template int Foo::exec2() { static void* table[2] = { &&begin, &&end }; if (counter++ > 10) return 0; goto *(table[0]); begin: if (isFalse()) f1(); end: return 1; } template void Foo::execute() { int r = 1; while (r) { r = exec2(); } } template class Foo; int main() { Foo c; c.execute(); if (counter < 10) abort (); return 0; }