(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
array-15.c
       1  /* PR c/69262 */
       2  /* { dg-do compile } */
       3  /* { dg-options "-std=c11 -pedantic-errors" } */
       4  
       5  struct S
       6  {
       7    int a[1][][2]; /* { dg-error "array type has incomplete element type" } */
       8    /* { dg-message "declaration of .a. as multidimensional array must have bounds" "" { target *-*-* } .-1 } */
       9  };
      10  
      11  struct R
      12  {
      13    int i;
      14    int a[][]; /* { dg-error "array type has incomplete element type" } */
      15    /* { dg-message "declaration of .a. as multidimensional array must have bounds" "" { target *-*-* } .-1 } */
      16  };
      17  
      18  typedef int T[];
      19  typedef int U[][]; /* { dg-error "array type has incomplete element type" } */
      20  /* { dg-message "declaration of .U. as multidimensional array must have bounds" "" { target *-*-* } .-1 } */
      21  
      22  int x[][]; /* { dg-error "array type has incomplete element type" } */
      23  /* { dg-message "declaration of .x. as multidimensional array must have bounds" "" { target *-*-* } .-1 } */
      24  
      25  struct N;
      26  
      27  void
      28  fn1 (int z[][]) /* { dg-error "array type has incomplete element type" } */
      29  /* { dg-message "declaration of .z. as multidimensional array must have bounds" "" { target *-*-* } .-1 } */
      30  {
      31    int a[1][][2]; /* { dg-error "array type has incomplete element type" } */
      32    /* { dg-message "declaration of .a. as multidimensional array must have bounds" "" { target *-*-* } .-1 } */
      33    /* OK */
      34    int b[3][2][1];
      35    int c[1][2][3][]; /* { dg-error "array type has incomplete element type" } */
      36    /* { dg-message "declaration of .c. as multidimensional array must have bounds" "" { target *-*-* } .-1 } */
      37    T d[1]; /* { dg-error "array type has incomplete element type" } */
      38    /* { dg-message "declaration of .d. as multidimensional array must have bounds" "" { target *-*-* } .-1 } */
      39    T e[]; /* { dg-error "array type has incomplete element type" } */
      40    /* { dg-message "declaration of .e. as multidimensional array must have bounds" "" { target *-*-* } .-1 } */
      41  
      42    /* This array has incomplete element type, but is not multidimensional.  */
      43    struct N f[1]; /* { dg-error "array type has incomplete element type" } */
      44    /* { dg-bogus "declaration of .f. as multidimensional array must have bounds" "" { target *-*-* } .-1 } */
      45  }
      46  
      47  void fn2 (int [][]); /* { dg-error "array type has incomplete element type" } */
      48  /* { dg-message "declaration of multidimensional array must have bounds" "" { target *-*-* } .-1 } */
      49  /* OK */
      50  void fn3 (int [][*]);
      51  void fn4 (T []); /* { dg-error "array type has incomplete element type" } */
      52  /* { dg-message "declaration of multidimensional array must have bounds" "" { target *-*-* } .-1 } */