summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/PR40625.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Analysis/PR40625.cpp')
-rw-r--r--clang/test/Analysis/PR40625.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Analysis/PR40625.cpp b/clang/test/Analysis/PR40625.cpp
new file mode 100644
index 00000000000..6cc27d39b6c
--- /dev/null
+++ b/clang/test/Analysis/PR40625.cpp
@@ -0,0 +1,16 @@
+// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=core,alpha.core.CallAndMessageUnInitRefArg %s -verify
+
+void f(const int *end);
+
+void g(const int (&arrr)[10]) {
+ f(arrr+sizeof(arrr)); // expected-warning{{1st function call argument is a pointer to uninitialized value}}
+ // FIXME: This is a false positive that should be fixed. Until then this
+ // tests the crash fix in FindLastStoreBRVisitor (beside
+ // uninit-vals.m).
+}
+
+void h() {
+ int arr[10];
+
+ g(arr);
+}
OpenPOWER on IntegriCloud