summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2017-09-18 18:37:04 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2017-09-18 18:37:04 +0000
commit1f33dfaf7dec38091a5a22abb6b97fca1564beb4 (patch)
treed906f423015aa1b8a2e32884f70ed03b1036c97d
parentcb387e41e4c4fef72812e4948f54494c3d54b7ee (diff)
downloadgcc-1f33dfaf7dec38091a5a22abb6b97fca1564beb4.tar.gz
PR c++/78840 - ICE with const and nested generic lambda
* g++.dg/cpp1y/lambda-generic-const5.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@252944 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/lambda-generic-const5.C17
1 files changed, 17 insertions, 0 deletions
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<int I> void Foo () {
+ const int cst = global;
+ auto lam0 = [&]() -> void {
+ auto lam1 = [&]() -> void { cst; };
+
+ Bar (cst);
+ };
+}
+
+template void Foo <0> ();