Debian Codegraph @

gcc/testsuite/g++.dg/parse/pr31952-2.C

raw
1 // PR c++/31952
2
3 // Explicit { dg-require-effective-target exceptions_enabled } to avoid verify compiler messages FAILs for '-fno-exceptions'.
4
5 void
6 f0()
7 {
8 try
9 {
10 }
11 catch (void *e) // { dg-message "previously" }
12 {
13 void *e; // { dg-error "redeclaration" }
14 }
15 }
16
17 void
18 f1()
19 {
20 try
21 {
22 }
23 catch (void *e)
24 {
25 {
26 void *e; // Ok, not outermost block.
27 }
28 }
29 }
30
31 void
32 f2()
33 try
34 {
35 }
36 catch (void *e) // { dg-message "previously" }
37 {
38 void *e; // { dg-error "redeclaration" }
39 }
40
41 void
42 f3()
43 try
44 {
45 }
46 catch (void *e)
47 {
48 {
49 void *e; // Ok, not outermost block.
50 }
51 }