FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.dg / eh / template1.C
blob2cbf9c698b081bb7ae75eeeca52abccea6495f14
1 // Test whether exception specifier dependent on template parameter
2 // is accepted during template decl processing.
3 // { dg-do run }
5 extern "C" void abort();
7 class A {};
9 template <class T>
10 struct B
12   typedef A E;
15 template <class T>
16 struct C
18   typedef B<T> D;
19   typedef typename D::E E;
20   void f() throw(E) { throw E(); }
23 int main()
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;