summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wshadow-local-1.c
blob: 161f9941fb69300f09d6ee3a3a50bccceb8291e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-do compile } */
/* { dg-options "-Wshadow=local" } */

int decl1;			/* should not warn */
void foo (double decl1)		/* should not warn */
{				
}

void foo2 (int d)		/* { dg-message "shadowed declaration" } */
{
  {
    double d;			/* { dg-warning "shadows a parameter" } */
  }
}

void foo3 ()
{
  int local;			/* { dg-message "shadowed declaration" } */
  {
    int local;			/* { dg-warning "shadows a previous local" } */
  }
}