summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-02-16 23:39:09 +0000
committerTed Kremenek <kremenek@apple.com>2011-02-16 23:39:09 +0000
commit197fcd44188b6923a515ac8a9798501af165cd8f (patch)
treefee4ee253b2d2421c7915f9931da933e557f7796 /clang/test
parentf4ecaa576c9e24e434260b885033b08ae0a5e966 (diff)
downloadbcm5719-llvm-197fcd44188b6923a515ac8a9798501af165cd8f.tar.gz
bcm5719-llvm-197fcd44188b6923a515ac8a9798501af165cd8f.zip
Fix assertion failure in -Warray-bounds on template parameters used as arrays.
llvm-svn: 125693
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/array-bounds.cpp (renamed from clang/test/Sema/array-bounds.c)5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/Sema/array-bounds.c b/clang/test/SemaCXX/array-bounds.cpp
index b9dbe6344a0..d60600fd4bc 100644
--- a/clang/test/Sema/array-bounds.c
+++ b/clang/test/SemaCXX/array-bounds.cpp
@@ -14,3 +14,8 @@ int foo() {
x[sizeof(x[2])]; // expected-warning{{array index of '4' indexes past the end of an array (that contains 2 elements)}}
}
+// This code example tests that -Warray-bounds works with arrays that
+// are template parameters.
+template <char *sz> class Qux {
+ bool test() { return sz[0] == 'a'; }
+}; \ No newline at end of file
OpenPOWER on IntegriCloud