From 10f61650f7620a86c7cd48468810082078a09457 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 29 Aug 2017 16:21:23 -0400 Subject: [PATCH] PR c++/78840 - ICE with const and nested generic lambda * g++.dg/cpp1y/lambda-generic-const5.C: New. From-SVN: r251431 --- .../g++.dg/cpp1y/lambda-generic-const5.C | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1y/lambda-generic-const5.C diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-const5.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-const5.C new file mode 100644 index 00000000000..65e52ccd01f --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-const5.C @@ -0,0 +1,17 @@ +// PR c++/78840 +// { dg-do compile { target c++14 } } + +int global; + +void Bar (int); + +template void Foo () { + const int cst = global; + auto lam0 = [&]() -> void { + auto lam1 = [&]() -> void { cst; }; + + Bar (cst); + }; +} + +template void Foo <0> (); -- 2.30.2