From b270a5215a4ed5a99efa93ed34a98eab75fe13c7 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 12 Mar 2018 10:02:36 +0100 Subject: [PATCH] re PR c++/84813 (internal compiler error: Segmentation fault with lambdas and constexpr variables) PR c++/84813 * g++.dg/debug/pr84813.C: New test. From-SVN: r258445 --- gcc/testsuite/ChangeLog | 7 +++++- gcc/testsuite/g++.dg/debug/pr84813.C | 33 ++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/debug/pr84813.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 883fbb0c6a0..69c00d1b23e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,7 +1,12 @@ +2018-03-12 Jakub Jelinek + + PR c++/84813 + * g++.dg/debug/pr84813.C: New test. + 2018-03-11 Paul Thomas 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 diff --git a/gcc/testsuite/g++.dg/debug/pr84813.C b/gcc/testsuite/g++.dg/debug/pr84813.C new file mode 100644 index 00000000000..af23b309cba --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/pr84813.C @@ -0,0 +1,33 @@ +// PR c++/84813 +// { dg-do compile } +// { dg-options "-g -std=c++14" } + +template +struct P {}; + +template +struct F { + using type = int; +}; + +template +void +apply () +{ + constexpr int N = T::N; + [] (typename F::type) + { + auto f = [] () {}; + P{}; + }; +} + +struct A { + static constexpr int N = 1; +}; + +void +instantiate () +{ + apply (); +} -- 2.30.2