Deduce a ConstantArrayType from a value-dependent initializer list
rather than punting to a DependentSizedArrayType, tightening up our
type checking for template definitions. Thanks, John!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89407 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/dependent-sized_array.cpp b/test/SemaTemplate/dependent-sized_array.cpp
index 77b2bdc..d221a4d 100644
--- a/test/SemaTemplate/dependent-sized_array.cpp
+++ b/test/SemaTemplate/dependent-sized_array.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -verify %s
+// RUN: clang-cc -fsyntax-only -pedantic -verify %s
template<int N>
void f() {
@@ -8,3 +8,10 @@
template void f<17>();
+
+template<int N>
+void f1() {
+ int a0[] = {}; // expected-warning{{zero}}
+ int a1[] = { 1, 2, 3, N };
+ int a3[sizeof(a1)/sizeof(int) != 4? 1 : -1]; // expected-error{{negative}}
+}