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