aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-4.c
blob: f3b986fa6035ffbcd04ffe007f1bdb460680ed4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* { dg-do compile } */
/* { dg-options "-Wshadow -Wsystem-headers" } */

#include "Wshadow-4.h"
extern void index2 (void); /* { dg-message "declaration is here" } */

void foo (double index1,
	  double index2)
{
}

void foo1 (void)
{
  double index1;
  double index2;
}

void foo2 (void)
{
  {
    double index1;
    double index2;
  }
}

void foo3 (void)
{
  void (*index1)(void); /* { dg-warning "shadows" } */
  void (*index2)(void); /* { dg-warning "shadows" } */
}

void foo4 (void)
{
  void index1(void) {}; /* { dg-warning "shadows" } */
  void index2(void) {}; /* { dg-warning "shadows" } */
}

/* { dg-message "declaration is here" "" { target *-*-* } 0 } */