casts.cpp revision 570d03c6831a8e19447dc863aa94ffff020077eb
1// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-store=region -verify %s
2
3void fill_r (int * const &x);
4
5char testPointer () {
6  int x[8];
7  int *xp = x;
8  fill_r(xp);
9
10  return x[0]; // no-warning
11}
12
13char testArray () {
14  int x[8];
15  fill_r(x);
16
17  return x[0]; // no-warning
18}
19
20char testReferenceCast () {
21  int x[8];
22  int *xp = x;
23  fill_r(reinterpret_cast<int * const &>(xp));
24
25  return x[0]; // no-warning
26}
27
28
29void fill (int *x);
30char testReferenceCastRValue () {
31  int x[8];
32  int *xp = x;
33  fill(reinterpret_cast<int * const &>(xp));
34
35  return x[0]; // no-warning
36}
37