From 92395f1c2473db7898ca06fa9b17f144564554df Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 10 Oct 2017 20:16:40 +0000 Subject: [PATCH] re PR c++/81032 (ICE with lambda and broken constexpr) 2017-10-10 Paolo Carlini PR c++/81032 * g++.dg/cpp1y/lambda-generic-ice6.C: New. From-SVN: r253619 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice6.C | 13 +++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice6.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0eadf82a31d..14c2a5ad907 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-10-10 Paolo Carlini + + PR c++/81032 + * g++.dg/cpp1y/lambda-generic-ice6.C: New. + 2017-10-10 Jakub Jelinek PR rtl-optimization/68205 diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice6.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice6.C new file mode 100644 index 00000000000..6851afc860e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice6.C @@ -0,0 +1,13 @@ +// PR c++/81032 +// { dg-do compile { target c++14 } } + +template constexpr void foo(T t) +{ + constexpr int i = t; // { dg-error "constant" } + [=](auto){ return i; }(0); +} + +void bar() +{ + foo(0); +} -- 2.30.2