diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-4.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-4.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-4.c new file mode 100644 index 000000000..f3b986fa6 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-4.c @@ -0,0 +1,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 } */ |