assign.c revision d7d5f0223bd30dfd618762349c6209dd1d5ea3e6
1// RUN: clang-cc -fsyntax-only -verify %s
2
3void *test1(void) { return 0; }
4
5void test2 (const struct {int a;} *x) {
6  x->a = 10; // expected-error {{read-only variable is not assignable}}
7}
8
9typedef int arr[10];
10void test3() {
11  const arr b;
12  const int b2[10];
13  b[4] = 1; // expected-error {{read-only variable is not assignable}}
14  b2[4] = 1; // expected-error {{read-only variable is not assignable}}
15}
16