summaryrefslogtreecommitdiffstats
path: root/test/Sema/anonymous-struct-union.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/anonymous-struct-union.c')
-rw-r--r--test/Sema/anonymous-struct-union.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/Sema/anonymous-struct-union.c b/test/Sema/anonymous-struct-union.c
index 652383e..c33bc52 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'}}
}
OpenPOWER on IntegriCloud