Mercurial > hg > CbC > CbC_llvm
comparison clang/test/Sema/assign.c @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | 1d019706d866 |
children | c4bab56944e8 |
comparison
equal
deleted
inserted
replaced
173:0572611fdcc8 | 207:2e18cbf3894f |
---|---|
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}} |