re PR c++/82882 (ICE Segmentation fault)
authorJakub Jelinek <jakub@redhat.com>
Tue, 23 Jan 2018 14:04:18 +0000 (15:04 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 23 Jan 2018 14:04:18 +0000 (15:04 +0100)
PR c++/82882
PR c++/83978
* g++.dg/cpp0x/pr82882.C: New test.
* g++.dg/cpp0x/pr83978.C: New test.

From-SVN: r256985

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr82882.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/pr83978.C [new file with mode: 0644]

index 8a997aa8614c14ce836892735f45eaf6fab5043d..5c1d57f7ed246ce0d6348f93c363bdcb4acd64af 100644 (file)
@@ -1,5 +1,10 @@
 2018-01-23  Jakub Jelinek  <jakub@redhat.com>
 
+       PR c++/82882
+       PR c++/83978
+       * g++.dg/cpp0x/pr82882.C: New test.
+       * g++.dg/cpp0x/pr83978.C: New test.
+
        PR c++/83958
        * g++.dg/cpp1z/decomp35.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr82882.C b/gcc/testsuite/g++.dg/cpp0x/pr82882.C
new file mode 100644 (file)
index 0000000..d4f35d6
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/82882
+// { dg-do compile { target c++11 } }
+
+template <typename>
+void
+foo ()
+{
+  auto v = [] { enum { E, F }; };
+}
+
+void
+bar ()
+{
+  foo<int> ();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr83978.C b/gcc/testsuite/g++.dg/cpp0x/pr83978.C
new file mode 100644 (file)
index 0000000..ce1e51e
--- /dev/null
@@ -0,0 +1,6 @@
+// PR c++/83978
+// { dg-do compile { target c++11 } }
+
+template <int N>
+struct A { A () { auto a = [] { enum E { F }; }; } };
+A<0> *p = new A<0> ();