1// { dg-do run } 2namespace { 3struct IFoo { virtual void foo() = 0; }; 4struct IBar { virtual void bar() = 0; }; 5 6struct FooBar : private IBar, private IFoo 7{ 8 void call_foo() 9 { 10 try 11 { 12 static_cast<IFoo*>(this)->foo(); 13 } 14 catch( ... ) {} 15 } 16 void foo() { throw 1; } 17 void bar() {} 18}; 19 20void test() 21{ 22 FooBar foobar; 23 foobar.call_foo(); 24} 25} 26int main() 27{ 28 test(); 29 return 0; 30} 31 32