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(); +}