From ee8b2b8ea44097072e2df28f1b248d45ddd4c0fd Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Thu, 28 Feb 2019 10:27:03 +0000 Subject: [PATCH] re PR c++/89522 (ICE: trying to capture 'f' in instantiation of generic lambda) 2019-02-28 Paolo Carlini PR c++/89522 * g++.dg/cpp1y/lambda-generic-ice10.C: New. From-SVN: r269275 --- gcc/testsuite/ChangeLog | 5 +++++ .../g++.dg/cpp1y/lambda-generic-ice10.C | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice10.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c711829816e..8c80d5e88d1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-02-28 Paolo Carlini + + PR c++/89522 + * g++.dg/cpp1y/lambda-generic-ice10.C: New. + 2019-02-28 Jakub Jelinek PR c/89525 diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice10.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice10.C new file mode 100644 index 00000000000..c46acecdae1 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice10.C @@ -0,0 +1,18 @@ +// PR c++/89522 +// { dg-do compile { target c++14 } } + +template +void foo (F f) +{ + f (1); +} +template +void bar (T) +{ + auto f = [&](auto i) { if (f); }; // { dg-error "use of .f. before deduction of .auto." } + foo (f); +} +int main () +{ + bar (0); +} -- 2.30.2