Debian Codegraph @

gcc/testsuite/g++.dg/diagnostic/redeclaration-1.C

raw
1 void
2 foo (int i) // { dg-message "10:.int i. previously declared here" }
3 {
4 int i // { dg-error "7:declaration of .int i. shadows a parameter" }
5 (0);
6
7 for (int j ;;) // { dg-message "12:.int j. previously declared here" }
8 int j // { dg-error "9:redeclaration of .int j." }
9 (0);
10 }
11
12 void
13 bar (int i) // { dg-message "10:.int i. previously declared here" }
14 try
15 { }
16 catch (...)
17 {
18 int i // { dg-error "11:declaration of .int i. shadows a parameter" }
19 (0);
20 }