re PR c++/71875 (template specialization compile error)
authorJakub Jelinek <jakub@redhat.com>
Tue, 10 Oct 2017 20:10:00 +0000 (22:10 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 10 Oct 2017 20:10:00 +0000 (22:10 +0200)
PR c++/71875
* g++.dg/cpp1y/pr71875.C: New test.

From-SVN: r253613

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/pr71875.C [new file with mode: 0644]

index 7e52744c9f27f5a77a34ce995c9681cc07173638..307acde68c8c32d3b80704b957ff1fb1c7ff9acf 100644 (file)
@@ -1,5 +1,8 @@
 2017-10-10  Jakub Jelinek  <jakub@redhat.com>
 
+       PR c++/71875
+       * g++.dg/cpp1y/pr71875.C: New test.
+
        PR c++/77578
        * g++.dg/gomp/pr77578.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr71875.C b/gcc/testsuite/g++.dg/cpp1y/pr71875.C
new file mode 100644 (file)
index 0000000..4d31796
--- /dev/null
@@ -0,0 +1,24 @@
+// PR c++/71875
+// { dg-do link { target c++14 } }
+
+template <typename T>
+constexpr bool IsMatrix = false;
+
+template<typename TElem>
+class Matrix {};
+
+template <typename TElem>
+constexpr bool IsMatrix<Matrix<TElem>> = true;
+
+template<typename TNestVec>
+class RowVecExpMatrix;
+
+template <typename TNestVec>
+constexpr bool IsMatrix<RowVecExpMatrix<TNestVec>> = true;
+
+int
+main ()
+{
+  static_assert (IsMatrix<RowVecExpMatrix<Matrix<int>>>, "Matrix check error");
+  static_assert (IsMatrix<Matrix<int>>, "Input type is not a matrix");
+}