diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-02-15 20:49:05 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-02-15 20:49:05 +0000 |
| commit | 5df36aae6442dbc915e71d1f0339b615af064b1b (patch) | |
| tree | 61d7c7f2e6672b6a34584efb7757f9fa14742759 /test/Analysis/PR40625.cpp | |
| parent | d87c9e7da2e87f224c426832f08897269c2e5636 (diff) | |
Notes
Diffstat (limited to 'test/Analysis/PR40625.cpp')
| -rw-r--r-- | test/Analysis/PR40625.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Analysis/PR40625.cpp b/test/Analysis/PR40625.cpp new file mode 100644 index 000000000000..6cc27d39b6c0 --- /dev/null +++ b/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); +} |
