view gcc/testsuite/gcc.dg/funcdef-var-2.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* 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-message "note: previous declaration" "previous declaration" { target *-*-* } .-1 } */
void foo () {} /* { dg-error "redeclared as different kind of symbol" } */
/* { dg-warning "no previous prototype" "no previous prototype" { target *-*-* } .-1 } */