aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/funcdef-var-2.c
blob: 744987ebf3b1c7e7e3cba1310d6546579f56c70d (plain)
1
2
3
4
5
6
7
8
9
10
11
/* Test ICE on defining function with a name previously declared as a
   nonfunction.  Bug 28299 from Bernhard Fischer <aldot@gcc.gnu.org>.
   Reduced testcase from Volker Reichelt <reichelt@gcc.gnu.org>.  */

/* { dg-do compile } */
/* { dg-options "-Wmissing-prototypes" } */

int foo;
/* { dg-error "previous declaration" "previous declaration" { target *-*-* } 8 } */
void foo () {} /* { dg-error "redeclared as different kind of symbol" } */
/* { dg-warning "no previous prototype" "no previous prototype" { target *-*-* } 10 } */