summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/funcdef-var-1.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-25 21:11:46 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-25 21:11:46 +0000
commit4d5ac30e9f47263ee5925a85e0a4e6c531a4981e (patch)
treec5d660b0cc2b1511757821e913c937802626245b /gcc/testsuite/gcc.dg/funcdef-var-1.c
parent376d06105c079e7bcbfea0b440f938f7fe76546a (diff)
downloadgcc-4d5ac30e9f47263ee5925a85e0a4e6c531a4981e.tar.gz
PR c/28299
* c-decl.c (start_function): Don't try to process prototype information from old declaration that isn't a function. testsuite: * gcc.dg/funcdef-var-1.c, gcc.dg/funcdef-var-2.c: New tests. * gcc.dg/pr20368-1.c, gcc.dg/pr20368-2.c, gcc.dg/pr20368-3.c: Expect extra diagnostics. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116435 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/funcdef-var-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/funcdef-var-1.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/funcdef-var-1.c b/gcc/testsuite/gcc.dg/funcdef-var-1.c
new file mode 100644
index 00000000000..a685af7ac1c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/funcdef-var-1.c
@@ -0,0 +1,10 @@
+/* Test ICE on defining function with a name previously declared as a
+ nonfunction. Bug 28299 from Bernhard Fischer
+ <aldot@gcc.gnu.org>. */
+/* { dg-do compile } */
+/* { dg-options "-Wmissing-prototypes" } */
+
+extern __typeof(foo) foo __asm__(""); /* { dg-error "undeclared" } */
+/* { dg-error "previous declaration" "previous declaration" { target *-*-* } 7 } */
+void *foo (void) {} /* { dg-error "redeclared as different kind of symbol" } */
+/* { dg-warning "no previous prototype" "no previous prototype" { target *-*-* } 9 } */