repo.or.cz
/
llvm-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git]
/
clang
/
test
/
Sema
/
2007-10-01-BuildArrayRef.c
blob
0a3e9d4238f5633bd7620a00e6c7063e9b3baa37
1
// RUN: %clang_cc1 -fsyntax-only -verify %s
2
// PR 1603
3
void
func
(
void
)
4
{
5
const int
*
arr
;
6
arr
[
0
] =
1
;
// expected-error {{read-only variable is not assignable}}
7
}
8
9
struct
foo
{
10
int
bar
;
11
};
12
struct
foo sfoo
= {
0
};
13
14
int
func2
(
void
)
15
{
16
const struct
foo
*
fp
;
17
fp
= &
sfoo
;
18
fp
[
0
].
bar
=
1
;
// expected-error {{read-only variable is not assignable}}
19
return
sfoo
.
bar
;
20
}