summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c99-array-nonobj-1.c
blob: d4566b701058cd9d92a8aa219165526f187a4919 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* Test for arrays of incomplete and function types: a constraint violation
   in C99 only, though undefined (DR#047) before.
*/
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
/* { dg-do compile } */
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */

typedef void func (void);
struct s;

extern int a[][]; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "array" "\[\]\[\] var" { target *-*-* } .-1 } */

void f (int [][]); /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "array" "\[\]\[\] arg" { target *-*-* } .-1 } */

extern struct s b[]; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "array" "struct \[\] var" { target *-*-* } .-1 } */

void g (struct s []); /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "array" "struct \[\] arg" { target *-*-* } .-1 } */

extern func c[]; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "array" "func \[\] var" { target *-*-* } .-1 } */

void h (func []); /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "array" "func \[\] arg" { target *-*-* } .-1 } */