summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1y/var-templ39.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp1y/var-templ39.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/var-templ39.C16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ39.C b/gcc/testsuite/g++.dg/cpp1y/var-templ39.C
new file mode 100644
index 00000000000..e06519d5482
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/var-templ39.C
@@ -0,0 +1,16 @@
+// PR c++/66260
+// { dg-do compile { target c++14 } }
+
+template <class>
+constexpr bool foo = false;
+template <>
+constexpr bool foo<int> = true;
+template <class T, int N>
+constexpr bool foo<T[N]> = foo<T>;
+
+static_assert(foo<int>, "");
+static_assert(!foo<double>, "");
+static_assert(foo<int[3]>, "");
+static_assert(!foo<double[3]>, "");
+static_assert(foo<int[2][5][3]>, "");
+static_assert(!foo<double[2][5][3]>, "");