diff options
author | dalej <dalej@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-12-17 20:05:34 +0000 |
---|---|---|
committer | dalej <dalej@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-12-17 20:05:34 +0000 |
commit | a49e09d9c70821eabefc064d183a6768f2613c92 (patch) | |
tree | cc6ac8b5b4b86542f8bc16178aa7879397343679 /gcc/testsuite/gcc.dg/20041213-1.c | |
parent | 8c0a082a3d370925719d065549d7e7d076b32c85 (diff) | |
download | gcc-a49e09d9c70821eabefc064d183a6768f2613c92.tar.gz |
2004-12-17 Dale Johannesen <dalej@apple.com>
* c-decl.c (diagnose_mismatched_decls): Accept mismatched
function types: void with previous implicit int.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92329 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/20041213-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/20041213-1.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/20041213-1.c b/gcc/testsuite/gcc.dg/20041213-1.c new file mode 100644 index 00000000000..99027371447 --- /dev/null +++ b/gcc/testsuite/gcc.dg/20041213-1.c @@ -0,0 +1,32 @@ +/* { dg-do compile } */ +/* test redeclarations with void and implicit int */ +extern foo1(); /* { dg-error "error: previous declaration" } */ +extern void foo1(); /* { dg-error "error: conflicting types" } */ + +extern void foo2(); /* { dg-error "error: previous declaration" } */ +extern foo2(); /* { dg-error "error: conflicting types" } */ + +void foo3() {} /* { dg-error "error: previous definition" } */ +extern foo3(); /* { dg-error "error: conflicting types" } */ + +extern foo4(); /* { dg-error "error: previous declaration" } */ +void foo4() {} /* { dg-error "error: conflicting types" } */ + +extern void foo5(); /* { dg-warning "previous declaration" } */ +foo5() {} /* { dg-warning "conflicting types" } */ + +foo6() {} /* { dg-error "error: previous definition" } */ +extern void foo6(); /* { dg-error "error: conflicting types" } */ + +foo7() {} /* { dg-error "error: previous definition" } */ +void foo7() {} /* { dg-error "error: conflicting types" } */ + +void foo8() {} /* { dg-error "error: previous definition" } */ +foo8() {} /* { dg-error "error: conflicting types" } */ + +int use9() { foo9(); } /* { dg-warning "previous implicit declaration" } */ +extern void foo9(); /* { dg-warning "conflicting types" } */ + +int use10() { foo10(); } /* { dg-warning "previous implicit declaration" } */ +void foo10() {} /* { dg-warning "conflicting types" } */ + |