| Daniel Dunbar | ffd408a | 2009-03-24 02:24:46 +0000 | [diff] [blame^] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
| Chris Lattner | 73ae75b | 2007-08-28 16:20:14 +0000 | [diff] [blame] | 2 | |
| 3 | void *test1(void) { return 0; } |
| 4 | |
| Eli Friedman | 76b4983 | 2008-02-06 22:48:16 +0000 | [diff] [blame] | 5 | void test2 (const struct {int a;} *x) { |
| 6 | x->a = 10; // expected-error {{read-only variable is not assignable}} |
| 7 | } |
| Steve Naroff | ac26e9a | 2008-02-09 16:59:44 +0000 | [diff] [blame] | 8 | |
| 9 | typedef int arr[10]; |
| 10 | void 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 | } |