From: Paolo Carlini Date: Mon, 5 Mar 2018 10:19:11 +0000 (+0000) Subject: re PR c++/82022 (constexpr lambda in template context: expression ‘’ is not... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a0445a5fb136ba2328998385fc42988c512d447e;p=gcc.git re PR c++/82022 (constexpr lambda in template context: expression ‘’ is not a constant expression) 2018-03-05 Paolo Carlini PR c++/82022 * g++.dg/cpp1z/constexpr-lambda20.C: New. From-SVN: r258241 --- 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(); +}