gcc/testsuite/g++.dg/parse/pr31952-3.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 | int |
| 6 | f0 (int bar) // { dg-message "previously" } |
| 7 | try |
| 8 | { |
| 9 | return 0; |
| 10 | } |
| 11 | catch (int bar) // { dg-error "shadows a parameter" } |
| 12 | { |
| 13 | return 1; |
| 14 | } |
| 15 | |
| 16 | int |
| 17 | f1 (int bar) |
| 18 | { |
| 19 | try |
| 20 | { |
| 21 | return 0; |
| 22 | } |
| 23 | catch (int bar) // Ok, not a function-try-block. |
| 24 | { |
| 25 | return 1; |
| 26 | } |
| 27 | } |