diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
| commit | 5e20cdd81c44a443562a09007668ffdf76c455af (patch) | |
| tree | dbbd4047878da71c1a706e26ce05b4e7791b14cc /test/Sema/anonymous-struct-union.c | |
| parent | d5f23b0b7528b5c3caed1ba14f897cc4aaa9e3c3 (diff) | |
Notes
Diffstat (limited to 'test/Sema/anonymous-struct-union.c')
| -rw-r--r-- | test/Sema/anonymous-struct-union.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/Sema/anonymous-struct-union.c b/test/Sema/anonymous-struct-union.c index 652383eabb72..c33bc52971e7 100644 --- a/test/Sema/anonymous-struct-union.c +++ b/test/Sema/anonymous-struct-union.c @@ -22,6 +22,7 @@ struct X { }; void test_unqual_references(struct X x, const struct X xc) { + // expected-note@-1 3{{variable 'xc' declared const here}} x.i = 0; x.f = 0.0; x.f2 = x.f; @@ -29,9 +30,9 @@ void test_unqual_references(struct X x, const struct X xc) { x.f3 = 0; // expected-error{{no member named 'f3'}} x.a = 0; - xc.d = 0.0; // expected-error{{read-only variable is not assignable}} - xc.f = 0; // expected-error{{read-only variable is not assignable}} - xc.a = 0; // expected-error{{read-only variable is not assignable}} + xc.d = 0.0; // expected-error{{cannot assign to variable 'xc' with const-qualified type 'const struct X'}} + xc.f = 0; // expected-error{{cannot assign to variable 'xc' with const-qualified type 'const struct X'}} + xc.a = 0; // expected-error{{cannot assign to variable 'xc' with const-qualified type 'const struct X'}} } |
