re PR c++/84813 (internal compiler error: Segmentation fault with lambdas and constex...
authorJakub Jelinek <jakub@gcc.gnu.org>
Mon, 12 Mar 2018 09:02:36 +0000 (10:02 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 12 Mar 2018 09:02:36 +0000 (10:02 +0100)
PR c++/84813
* g++.dg/debug/pr84813.C: New test.

From-SVN: r258445

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

index 883fbb0c6a0215599f4f8aca0c390f93646696ce..69c00d1b23e4c26e92bff54413ca838dd34299b0 100644 (file)
@@ -1,7 +1,12 @@
+2018-03-12  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/84813
+       * g++.dg/debug/pr84813.C: New test.
+
 2018-03-11  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/84546
-       * gfortran.dg/unlimited_polymorphic_29.f90 : New test.
+       * gfortran.dg/unlimited_polymorphic_29.f90: New test.
 
 2018-03-11  Steven G. Kargl  <kargl@gcc.gnu.org>
 
diff --git a/gcc/testsuite/g++.dg/debug/pr84813.C b/gcc/testsuite/g++.dg/debug/pr84813.C
new file mode 100644 (file)
index 0000000..af23b30
--- /dev/null
@@ -0,0 +1,33 @@
+// PR c++/84813
+// { dg-do compile }
+// { dg-options "-g -std=c++14" }
+
+template <typename>
+struct P {};
+
+template <int>
+struct F {
+  using type = int;
+};
+
+template <typename T>
+void
+apply ()
+{
+  constexpr int N = T::N;
+  [] (typename F<N>::type)
+  {
+    auto f = [] () {};
+    P<decltype (f)>{};
+  };
+}
+
+struct A {
+  static constexpr int N = 1;
+};
+
+void
+instantiate ()
+{
+  apply<A> ();
+}