From a0445a5fb136ba2328998385fc42988c512d447e Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 5 Mar 2018 10:19:11 +0000 Subject: [PATCH] =?utf8?q?re=20PR=20c++/82022=20(constexpr=20lambda=20in?= =?utf8?q?=20template=20context:=20expression=20=E2=80=98=E2=80=99?= =?utf8?q?=20is=20not=20a=20constant=20expression)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 2018-03-05 Paolo Carlini PR c++/82022 * g++.dg/cpp1z/constexpr-lambda20.C: New. From-SVN: r258241 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp1z/constexpr-lambda20.C | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1z/constexpr-lambda20.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 63adcbe988e..8e7e53b8546 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-03-05 Paolo Carlini + + PR c++/82022 + * g++.dg/cpp1z/constexpr-lambda20.C: New. + 2018-03-03 Harald Anlauf PR fortran/71085 diff --git a/gcc/testsuite/g++.dg/cpp1z/constexpr-lambda20.C b/gcc/testsuite/g++.dg/cpp1z/constexpr-lambda20.C new file mode 100644 index 00000000000..c5109b85de3 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/constexpr-lambda20.C @@ -0,0 +1,16 @@ +// PR c++/82022 +// { dg-options -std=c++17 } + +template +void f2() +{ + constexpr bool r = []() constexpr { return false; }(); + if constexpr (r); + if constexpr ([]() constexpr { return false; }()); +} + +int main() +{ + if constexpr ([]() constexpr { return false; }()); + f2(); +} -- 2.30.2