1 // Test whether exception specifier dependent on template parameter 2 // is accepted during template decl processing. 3 // { dg-do run } 4 5 extern "C" void abort(); 6 7 class A {}; 8 9 template <class T> 10 struct B 11 { 12 typedef A E; 13 }; 14 15 template <class T> 16 struct C 17 { 18 typedef B<T> D; 19 typedef typename D::E E; fC20 void f() throw(E) { throw E(); } 21 }; 22 main()23int main() 24 { 25 int caught = 0; 26 try 27 { 28 C<int> x; 29 x.f(); 30 } 31 catch (A) 32 { 33 ++caught; 34 } 35 if (caught != 1) 36 abort (); 37 return 0; 38 } 39