Mercurial > hg > CbC > CbC_llvm
comparison clang/test/Sema/assign.c @ 221:79ff65ed7e25
LLVM12 Original
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 15 Jun 2021 19:15:29 +0900 |
parents | 1d019706d866 |
children | c4bab56944e8 |
comparison
equal
deleted
inserted
replaced
220:42394fc6a535 | 221:79ff65ed7e25 |
---|---|
4 | 4 |
5 void test2 (const struct {int a;} *x) { | 5 void test2 (const struct {int a;} *x) { |
6 // expected-note@-1 {{variable 'x' declared const here}} | 6 // expected-note@-1 {{variable 'x' declared const here}} |
7 | 7 |
8 x->a = 10; | 8 x->a = 10; |
9 // expected-error-re@-1 {{cannot assign to variable 'x' with const-qualified type 'const struct (anonymous struct at {{.*}}assign.c:5:19) *'}} | 9 // expected-error-re@-1 {{cannot assign to variable 'x' with const-qualified type 'const struct (unnamed struct at {{.*}}assign.c:5:19) *'}} |
10 } | 10 } |
11 | 11 |
12 typedef int arr[10]; | 12 typedef int arr[10]; |
13 void test3() { | 13 void test3() { |
14 const arr b; // expected-note {{variable 'b' declared const here}} | 14 const arr b; // expected-note {{variable 'b' declared const here}} |