summaryrefslogtreecommitdiff
path: root/test/SemaCXX/static-array-member.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-09-09 01:45:28 +0000
committerDouglas Gregor <dgregor@apple.com>2009-09-09 01:45:28 +0000
commit3dab34a7cb5e2ad9c2311fc44b3d3b7ebb540992 (patch)
treedaae3f99f8e3c33c25c934b6747b5ae831117e4c /test/SemaCXX/static-array-member.cpp
parent3b6afbb99a1c44b4076f8e15fb7311405941b306 (diff)
downloadclang-3dab34a7cb5e2ad9c2311fc44b3d3b7ebb540992.tar.gz
Allow a declaration of an array to complete a prior, incomplete
declaration of that array in C++. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81309 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/static-array-member.cpp')
-rw-r--r--test/SemaCXX/static-array-member.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaCXX/static-array-member.cpp b/test/SemaCXX/static-array-member.cpp
new file mode 100644
index 0000000000..dac70cd2ea
--- /dev/null
+++ b/test/SemaCXX/static-array-member.cpp
@@ -0,0 +1,18 @@
+// RUN: clang-cc -fsyntax-only %s
+
+struct X0 {
+ static int array[];
+
+ int x;
+ int y;
+};
+
+int X0::array[sizeof(X0) * 2];
+
+template<typename T, int N>
+struct X1 {
+ static T array[];
+};
+
+template<typename T, int N>
+T X1<T, N>::array[N];