re PR c++/54090 (internal compiler error: in unify, at cp/pt.c:15731)
authorPaolo Carlini <paolo.carlini@oracle.com>
Sun, 15 Oct 2017 22:29:59 +0000 (22:29 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Sun, 15 Oct 2017 22:29:59 +0000 (22:29 +0000)
2017-10-15  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/54090
* g++.dg/template/crash128.C: New.

From-SVN: r253772

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

index d8436266a5bbd5d21ae91382bf9490c7dffc8c19..ff99cba66b702cadd4360a963a476ca5677310ed 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-15  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/54090
+       * g++.dg/template/crash128.C: New.
+
 2017-10-15  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/82372
diff --git a/gcc/testsuite/g++.dg/template/crash128.C b/gcc/testsuite/g++.dg/template/crash128.C
new file mode 100644 (file)
index 0000000..2682e3d
--- /dev/null
@@ -0,0 +1,19 @@
+// PR c++/54090
+
+template <int n>
+struct X {
+
+  template <int N, bool = (n >= N), typename T = void> struct Y;
+
+  template <int N, typename T>
+  struct Y<N, true, T> {};
+
+  static const int M = n / 2;
+
+  template <typename T>
+  struct Y<X::M, true, T> {};
+};
+
+void foo() {
+  X<10>::Y<10/2> y;
+}