Cope with an amusingly little anomaly with dependent types and
incomplete array initialization, where we have the following in a
template:

  int a[] = { 1, 2, something-value-dependent };
  // ...
  sizeof(a);

The type of "a" appears to be a non-dependent IncompleteArrayType, but
treating it as such makes the sizeof(a) fail at template definition
time. We now correctly handle this by morphing the IncompleteArrayType
into a DependentSizedArrayType with a NULL expression, indicating that
its size has no corresponding expression (and, therefore, the type is
distinct from others).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89366 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/dependent-sized_array.cpp b/test/SemaTemplate/dependent-sized_array.cpp
new file mode 100644
index 0000000..77b2bdc
--- /dev/null
+++ b/test/SemaTemplate/dependent-sized_array.cpp
@@ -0,0 +1,10 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+template<int N>
+void f() {
+  int a[] = { 1, 2, 3, N };
+  unsigned numAs = sizeof(a) / sizeof(int);
+}
+
+template void f<17>();
+