blob: 4ddb25a94afba95293d6e2917f63fdc0d95fb65d [file] [log] [blame]
Chris Lattner4045a8a2007-10-11 00:18:28 +00001// RUN: clang -fsyntax-only -verify %s
Chris Lattner73ae75b2007-08-28 16:20:14 +00002
3void *test1(void) { return 0; }
4
Eli Friedman76b49832008-02-06 22:48:16 +00005void test2 (const struct {int a;} *x) {
6 x->a = 10; // expected-error {{read-only variable is not assignable}}
7}
Steve Naroffac26e9a2008-02-09 16:59:44 +00008
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}