summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/array-bounds.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-12-14 06:54:03 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-12-14 06:54:03 +0000
commit26444c5243496953fa572bc0169f2ab006b1122a (patch)
tree21636cf906e9af81fa6b59b11404d7121360bc54 /clang/test/SemaCXX/array-bounds.cpp
parent6fada2ddbdfecde74d0515723a1a0caacbdd3445 (diff)
downloadbcm5719-llvm-26444c5243496953fa572bc0169f2ab006b1122a.tar.gz
bcm5719-llvm-26444c5243496953fa572bc0169f2ab006b1122a.zip
Have Sema::ActOnStartOfFunctionDef return the declaration that was passed it.
This fixes the missing warning here: struct S { template <typename T> void meth() { char arr[3]; arr[4] = 0; // warning: array index 4 is past the end of the array } }; template <typename T> void func() { char arr[3]; arr[4] = 0; // no warning } llvm-svn: 170180
Diffstat (limited to 'clang/test/SemaCXX/array-bounds.cpp')
-rw-r--r--clang/test/SemaCXX/array-bounds.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/array-bounds.cpp b/clang/test/SemaCXX/array-bounds.cpp
index 57a9e3de6a2..80b3ee42894 100644
--- a/clang/test/SemaCXX/array-bounds.cpp
+++ b/clang/test/SemaCXX/array-bounds.cpp
@@ -74,11 +74,11 @@ void test() {
}
template <int I> struct S {
- char arr[I]; // expected-note 2 {{declared here}}
+ char arr[I]; // expected-note 3 {{declared here}}
};
template <int I> void f() {
S<3> s;
- s.arr[4] = 0; // expected-warning {{array index 4 is past the end of the array (which contains 3 elements)}}
+ s.arr[4] = 0; // expected-warning 2 {{array index 4 is past the end of the array (which contains 3 elements)}}
s.arr[I] = 0; // expected-warning {{array index 5 is past the end of the array (which contains 3 elements)}}
}
OpenPOWER on IntegriCloud