* doc/invoke.texi: Document -std=c++17 and -std=gnu++17 and document
[official-gcc.git] / gcc / testsuite / g++.dg / eh / template1.C
blobb4de8d6809e2a9b8f2d4373a0d93c69434fa52b8
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()
21 #if __cplusplus <= 201402L
22   throw(E)                      // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } }
23 #endif
24   { throw E(); }
27 int main()
29   int caught = 0;
30   try
31     {
32       C<int> x;
33       x.f();
34     }
35   catch (A)
36     {
37       ++caught;
38     }
39   if (caught != 1)
40     abort ();
41   return 0;