diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-09-26 23:36:13 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-09-26 23:36:13 +0000 |
commit | d41f346875261dd64f44f2672a54ffdd8ee3203a (patch) | |
tree | 8d25b8b82c4e6892bb2d8e06cef2c3f6ead009db /clang/test/SemaCXX/array-bounds.cpp | |
parent | 8868faec63ce47d47b5b4c8e4414a8ca6c3d5833 (diff) | |
download | bcm5719-llvm-d41f346875261dd64f44f2672a54ffdd8ee3203a.tar.gz bcm5719-llvm-d41f346875261dd64f44f2672a54ffdd8ee3203a.zip |
Fix regression of -Warray-bounds involving varargs functions [PR 11007].
llvm-svn: 140584
Diffstat (limited to 'clang/test/SemaCXX/array-bounds.cpp')
-rw-r--r-- | clang/test/SemaCXX/array-bounds.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/array-bounds.cpp b/clang/test/SemaCXX/array-bounds.cpp index e071bc7b5bd..555ac33af55 100644 --- a/clang/test/SemaCXX/array-bounds.cpp +++ b/clang/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}} +} + |