aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/array-redeclaration.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-02 19:18:08 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-02 19:18:08 +0000
commitbab175ec4b075c8076ba14c762900392533f6ee4 (patch)
tree01f4f29419a2cb10abe13c1e63cd2a66068b0137 /test/SemaTemplate/array-redeclaration.cpp
parent8b7a8012d223fac5d17d16a66bb39168a9a1dfc0 (diff)
Notes
Diffstat (limited to 'test/SemaTemplate/array-redeclaration.cpp')
-rw-r--r--test/SemaTemplate/array-redeclaration.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/SemaTemplate/array-redeclaration.cpp b/test/SemaTemplate/array-redeclaration.cpp
new file mode 100644
index 0000000000000..4edee701cfc46
--- /dev/null
+++ b/test/SemaTemplate/array-redeclaration.cpp
@@ -0,0 +1,33 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
+
+extern int array[1];
+
+template <typename>
+class C {
+ enum { D };
+public:
+ template <typename A> void foo1() {
+ extern int array[((int)C<A>::k > (int)D) ? 1 : -1];
+ }
+};
+
+template<>
+class C<int> {
+public:
+ const static int k = 2;
+};
+
+void foo2() {
+ C<char> c;
+ c.foo1<int>();
+}
+
+template<int n>
+void foo3() {
+ extern int array[n ? 1 : -1];
+}
+
+void foo4() {
+ foo3<5>();
+}