PR tree-optimization/83369 - Missing diagnostics during inlining
[official-gcc.git] / gcc / testsuite / gcc.dg / Wredundant-decls-2.c
blob27c8e5d9f7d616f38827ddf9bc01a5d5b68facbf
1 /* Test for -Wredundant-decls warnings */
2 /* { dg-do compile } */
3 /* { dg-options "-Wredundant-decls" } */
5 int j = 5; /* { dg-message "5:note: previous" } */
6 int j; /* { dg-warning "5:redundant" } */
8 static int k;
9 static int k = 5; /* { dg-message "12:note: previous" } */
10 static int k; /* { dg-warning "12:redundant" } */
12 static int l = 5; /* { dg-message "12:note: previous" } */
13 static int l; /* { dg-warning "12:redundant" } */
15 static int m; /* { dg-message "12:note: previous" } */
16 static int m; /* { dg-warning "12:redundant" } */
17 static int m = 5;
19 int n; /* { dg-message "5:note: previous" } */
20 int n; /* { dg-warning "5:redundant" } */
21 int n = 5;
23 static int o;
24 static int o = 5;
26 int p;
27 int p = 5;