Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / warn / Wshadow-16.C
blobbbf3a463fe2ac1e25e5a8f671c7c747554e35d46
1 // PR c++/91868 - improve -Wshadow location.
2 // { dg-options "-Wshadow" }
4 int global; // { dg-message "shadowed declaration" }
6 struct S
8   static int bar; // { dg-message "shadowed declaration" }
9   S (int i) { int bar // { dg-warning "19:declaration of .bar. shadows a member" }
10       (1);
11     int global // { dg-warning "9:declaration of .global. shadows a global declaration" }
12       (42);
13   }
16 void
17 foo ()
19   int xx; // { dg-message "shadowed declaration" }
20   {
21     S xx // { dg-warning "7:declaration of .xx. shadows a previous local" }
22     (42);
23   }