Debian Codegraph @

gcc/testsuite/g++.dg/warn/Wexceptions3.C

raw
1 // PR c++/81660
2
3 // Explicit { dg-require-effective-target exceptions_enabled } to avoid verify compiler messages FAILs for '-fno-exceptions'.
4
5 void bar (int);
6
7 void
8 fn (int b)
9 {
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 }
31 }