aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/array-bounds.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-09-26 23:36:13 +0000
committerTed Kremenek <kremenek@apple.com>2011-09-26 23:36:13 +0000
commit615eb7c477eb0523bfc1d238c57cee9497c874e3 (patch)
tree4733e9a7722a293df981e43441d1313f62847782 /test/SemaCXX/array-bounds.cpp
parenteabdd6716dfe777a28435276fe6c89af77608b11 (diff)
Fix regression of -Warray-bounds involving varargs functions [PR 11007].
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140584 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/array-bounds.cpp')
-rw-r--r--test/SemaCXX/array-bounds.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaCXX/array-bounds.cpp b/test/SemaCXX/array-bounds.cpp
index e071bc7b5b..555ac33af5 100644
--- a/test/SemaCXX/array-bounds.cpp
+++ b/test/SemaCXX/array-bounds.cpp
@@ -226,3 +226,12 @@ void test_pr10771() {
// TODO: This should probably warn, too.
*(((char*)foo) + sizeof(foo)) = '\0'; // no-warning
}
+
+int test_pr11007_aux(const char * restrict, ...);
+
+// Test checking with varargs.
+void test_pr11007() {
+ double a[5]; // expected-note {{array 'a' declared here}}
+ test_pr11007_aux("foo", a[1000]); // expected-warning {{array index of '1000' indexes past the end of an array}}
+}
+