From 10885d138e6c4c46d64031eb345d73202a535949 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 10 Oct 2017 22:10:25 +0200 Subject: [PATCH] re PR c++/77786 (ICE in tsubst_copy, at cp/pt.c:13040) PR c++/77786 * g++.dg/cpp1y/pr77786.C: New test. From-SVN: r253614 --- gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/g++.dg/cpp1y/pr77786.C | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1y/pr77786.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 307acde68c8..c306573c5e9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2017-10-10 Jakub Jelinek + PR c++/77786 + * g++.dg/cpp1y/pr77786.C: New test. + PR c++/71875 * g++.dg/cpp1y/pr71875.C: New test. diff --git a/gcc/testsuite/g++.dg/cpp1y/pr77786.C b/gcc/testsuite/g++.dg/cpp1y/pr77786.C new file mode 100644 index 00000000000..e242228335c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/pr77786.C @@ -0,0 +1,21 @@ +// PR c++/77786 +// { dg-do compile { target c++14 } } + +#include + +template +void +foo (std::vector a) +{ + auto const a_size = a.size(); + auto bar = [&](auto y) -> void { int a_size_2 = a_size; }; + double x = 0.0; + bar (x); +} + +int +main () +{ + std::vector a(1); + foo<1>(a); +} -- 2.30.2