re PR c++/82022 (constexpr lambda in template context: expression ‘<lambda>’ is not a constant expression)

2018-03-05  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/82022
	* g++.dg/cpp1z/constexpr-lambda20.C: New.

From-SVN: r258241
This commit is contained in:
Paolo Carlini 2018-03-05 10:19:11 +00:00 committed by Paolo Carlini
parent e095eec19a
commit a0445a5fb1
2 changed files with 21 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2018-03-05 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/82022
* g++.dg/cpp1z/constexpr-lambda20.C: New.
2018-03-03 Harald Anlauf <anlauf@gmx.de>
PR fortran/71085

View File

@ -0,0 +1,16 @@
// PR c++/82022
// { dg-options -std=c++17 }
template <class T>
void f2()
{
constexpr bool r = []() constexpr { return false; }();
if constexpr (r);
if constexpr ([]() constexpr { return false; }());
}
int main()
{
if constexpr ([]() constexpr { return false; }());
f2<int>();
}