summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/dependent-sized_array.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-11-09 23:03:14 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-11-09 23:03:14 +0000
commitde63d36fb2101573f03e5104a0511a378e2473ac (patch)
tree1305bb5e666126168fe63ccd78a41dd203508ee8 /clang/test/SemaTemplate/dependent-sized_array.cpp
parent069a2df6fd0fa2b545116df27b9d2b3adb3e8464 (diff)
downloadbcm5719-llvm-de63d36fb2101573f03e5104a0511a378e2473ac.tar.gz
bcm5719-llvm-de63d36fb2101573f03e5104a0511a378e2473ac.zip
PR13788: Don't perform checks on the initializer of a dependently-typed
variable. Previously we didn't notice the type was dependent if the only dependence came from an array bound. Patch by Brian Brooks! llvm-svn: 167642
Diffstat (limited to 'clang/test/SemaTemplate/dependent-sized_array.cpp')
-rw-r--r--clang/test/SemaTemplate/dependent-sized_array.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/dependent-sized_array.cpp b/clang/test/SemaTemplate/dependent-sized_array.cpp
index cf0e0f37ee0..6fdcaa63e5a 100644
--- a/clang/test/SemaTemplate/dependent-sized_array.cpp
+++ b/clang/test/SemaTemplate/dependent-sized_array.cpp
@@ -15,3 +15,14 @@ void f1() {
int a1[] = { 1, 2, 3, N };
int a3[sizeof(a1)/sizeof(int) != 4? 1 : -1]; // expected-error{{negative}}
}
+
+namespace PR13788 {
+ template <unsigned __N>
+ struct S {
+ int V;
+ };
+ template <int N>
+ void foo() {
+ S<0> arr[N] = {{ 4 }};
+ }
+}
OpenPOWER on IntegriCloud