Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / warn / Wexceptions3.C
blob08d40bbf96ac9da300457c40275649d788a49263
1 // PR c++/81660
3 // Explicit { dg-require-effective-target exceptions_enabled } to avoid verify compiler messages FAILs for '-fno-exceptions'.
5 void bar (int);
7 void
8 fn (int b)
10   if (b)
11     throw;
12   try
13     {
14       bar (3);
15     }
16   catch (int)
17     {
18     }
19   catch (int) // { dg-warning "will be caught by earlier handler" }
20     {
21     }
22   catch (const int) // { dg-warning "will be caught by earlier handler" }
23     {
24     }
25   catch (int &) // { dg-warning "will be caught by earlier handler" }
26     {
27     }
28   catch (const int &) // { dg-warning "will be caught by earlier handler" }
29     {
30     }