diff options
| author | Steve Naroff <snaroff@apple.com> | 2008-02-09 16:59:44 +0000 |
|---|---|---|
| committer | Steve Naroff <snaroff@apple.com> | 2008-02-09 16:59:44 +0000 |
| commit | 45173e0ac08148644f006f205acf93591672b7f9 (patch) | |
| tree | 60c37f6d9ee0395f70ab20b5ae4623d148262b8b /clang/test | |
| parent | a62f3e13527a1099f9148a6a978d2886b354655f (diff) | |
| download | bcm5719-llvm-45173e0ac08148644f006f205acf93591672b7f9.tar.gz bcm5719-llvm-45173e0ac08148644f006f205acf93591672b7f9.zip | |
Fix <rdar://problem/5733511> clang doesn't emit error for const array.
llvm-svn: 46905
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Sema/assign.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Sema/assign.c b/clang/test/Sema/assign.c index b94d5835ee8..4ddb25a94af 100644 --- a/clang/test/Sema/assign.c +++ b/clang/test/Sema/assign.c @@ -5,3 +5,11 @@ void *test1(void) { return 0; } void test2 (const struct {int a;} *x) { x->a = 10; // expected-error {{read-only variable is not assignable}} } + +typedef int arr[10]; +void test3() { + const arr b; + const int b2[10]; + b[4] = 1; // expected-error {{read-only variable is not assignable}} + b2[4] = 1; // expected-error {{read-only variable is not assignable}} +} |

