[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Sema / crash-invalid-array.c
blob09731fa06f48e6aaa3f4989053b0f7c039994484
1 // RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s
2 // PR6913
4 int main(void)
6 int x[10][10];
7 int (*p)[] = x;
9 int i;
11 for(i = 0; i < 10; ++i)
13 p[i][i] = i; // expected-error {{subscript of pointer to incomplete type 'int[]'}}
17 // rdar://13705391
18 void foo(int a[*][2]) {(void)a[0][1]; } // expected-error {{variable length array must be bound in function definition}}
19 void foo1(int a[2][*]) {(void)a[0][1]; } // expected-error {{variable length array must be bound in function definition}}
20 void foo2(int a[*][*]) {(void)a[0][1]; } // expected-error {{variable length array must be bound in function definition}}
21 void foo3(int a[2][*][2]) {(void)a[0][1][1]; } // expected-error {{variable length array must be bound in function definition}}
22 void foo4(int a[2][*][*]) {(void)a[0][1][1]; } // expected-error {{variable length array must be bound in function definition}}