summaryrefslogtreecommitdiffstats
path: root/test/Sema/assign.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-05-27 18:47:56 +0000
committerdim <dim@FreeBSD.org>2015-05-27 18:47:56 +0000
commit3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 (patch)
treedbbd4047878da71c1a706e26ce05b4e7791b14cc /test/Sema/assign.c
parent38d6f2e7f2ce51a5b3836d26596c6c34a3288752 (diff)
downloadFreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.zip
FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.tar.gz
Vendor import of clang trunk r238337:
https://llvm.org/svn/llvm-project/cfe/trunk@238337
Diffstat (limited to 'test/Sema/assign.c')
-rw-r--r--test/Sema/assign.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/Sema/assign.c b/test/Sema/assign.c
index 2d57029..1fff778 100644
--- a/test/Sema/assign.c
+++ b/test/Sema/assign.c
@@ -3,7 +3,10 @@
void *test1(void) { return 0; }
void test2 (const struct {int a;} *x) {
- x->a = 10; // expected-error {{read-only variable is not assignable}}
+ // expected-note@-1 {{variable 'x' declared const here}}
+
+ x->a = 10;
+ // expected-error-re@-1 {{cannot assign to variable 'x' with const-qualified type 'const struct (anonymous struct at {{.*}}assign.c:5:19) *'}}
}
typedef int arr[10];
OpenPOWER on IntegriCloud