summaryrefslogtreecommitdiffstats
path: root/test/Analysis/reinterpret-cast.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
committerdim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
commit952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch)
treedf8df0b0067b381eab470a3b8f28d14a552a6340 /test/Analysis/reinterpret-cast.cpp
parentea266cad53e3d49771fa38103913d3ec7a166694 (diff)
downloadFreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip
FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'test/Analysis/reinterpret-cast.cpp')
-rw-r--r--test/Analysis/reinterpret-cast.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Analysis/reinterpret-cast.cpp b/test/Analysis/reinterpret-cast.cpp
index 59e6a53..cb7cbfd 100644
--- a/test/Analysis/reinterpret-cast.cpp
+++ b/test/Analysis/reinterpret-cast.cpp
@@ -86,3 +86,20 @@ namespace PR15345 {
clang_analyzer_eval(p->x == 42); // expected-warning{{TRUE}}
};
}
+
+int trackpointer_std_addressof() {
+ int x;
+ int *p = (int*)&reinterpret_cast<const volatile char&>(x);
+ *p = 6;
+ return x; // no warning
+}
+
+void set_x1(int *&);
+void set_x2(void *&);
+int radar_13146953(void) {
+ int *x = 0, *y = 0;
+
+ set_x1(x);
+ set_x2((void *&)y);
+ return *x + *y; // no warning
+} \ No newline at end of file
OpenPOWER on IntegriCloud