diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/funcdef-var-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/funcdef-var-2.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/funcdef-var-2.c b/gcc/testsuite/gcc.dg/funcdef-var-2.c new file mode 100644 index 000000000..b3eb2ce6a --- /dev/null +++ b/gcc/testsuite/gcc.dg/funcdef-var-2.c @@ -0,0 +1,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-message "note: 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 } */ |