1 // { dg-do run { target c++11 } } 2 struct A {}; 3 struct B {}; 4 struct C {}; 5 f(int idx)6template<typename... Exceptions> void f(int idx) throw(Exceptions...) { 7 if (idx == 0) throw A(); 8 else if (idx == 1) throw B(); 9 else if (idx == 2) throw C(); 10 } 11 12 extern "C" void abort(); 13 main()14int main() 15 { 16 try { 17 f<A, B, C>(0); 18 abort(); 19 } catch (A) { 20 } 21 try { 22 f<A, B, C>(1); 23 abort(); 24 } catch (B) { 25 } 26 try { 27 f<A, B, C>(2); 28 abort(); 29 } catch (C) { 30 } 31 return 0; 32 } 33