re PR c++/50436 (Crash or hang on invalid template code)
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 24 May 2016 21:32:29 +0000 (21:32 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 24 May 2016 21:32:29 +0000 (21:32 +0000)
2016-05-24  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/50436
* g++.dg/template/crash123.C: New.
* g++.dg/template/crash124.C: Likewise.

From-SVN: r236671

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

index 6c03e26718ba1715ee3ce5cbc64d73b81761c5e3..39c6b27cebfd22742fb698f27ca0115c4677e802 100644 (file)
@@ -1,3 +1,9 @@
+2016-05-24  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/50436
+       * g++.dg/template/crash123.C: New.
+       * g++.dg/template/crash124.C: Likewise.
+
 2016-05-24  Martin Sebor  <msebor@redhat.com>
 
        PR c++/71147
diff --git a/gcc/testsuite/g++.dg/template/crash123.C b/gcc/testsuite/g++.dg/template/crash123.C
new file mode 100644 (file)
index 0000000..20a4961
--- /dev/null
@@ -0,0 +1,19 @@
+// PR c++/50436
+
+template <bool> struct VI {};
+template <typename T>
+struct IP
+{
+  static const bool r = IP<T>::r;  // { dg-error "depth" }
+};
+template <typename T> struct V
+{
+  VI<IP<T>::r> vi;
+};
+struct X;
+struct Y
+{
+  V<X> v;  // { dg-message "from here" }
+};
+
+// { dg-prune-output "compilation terminated" }
diff --git a/gcc/testsuite/g++.dg/template/crash124.C b/gcc/testsuite/g++.dg/template/crash124.C
new file mode 100644 (file)
index 0000000..4931aa8
--- /dev/null
@@ -0,0 +1,21 @@
+// PR c++/50436
+
+template <bool> struct VI {};
+template <typename T>
+struct IP
+{
+  static const bool r = IP<T>::r;  // { dg-error "depth" }
+};
+template <typename T>
+struct V
+{
+  static const bool r = IP<T>::r;
+  VI<r> vi;
+};
+struct X;
+struct Y
+{
+  V<X> v;  // { dg-message "from here" }
+}
+
+// { dg-prune-output "compilation terminated" }