Files
gcc-reflection/gcc/testsuite/g++.dg/cpp1z/constexpr-lambda16.C
Jason Merrill 5d4e573b28 PR c++/80935 - wrong C++17 error with lambda
* decl.c (check_for_uninitialized_const_var): Check
	is_instantiation_of_constexpr.
	* constexpr.c (ensure_literal_type_for_constexpr_object): Check
	is_instantiation_of_constexpr.
	(potential_constant_expression_1): Check var_in_maybe_constexpr_fn.

From-SVN: r251429
2017-08-29 15:51:30 -04:00

17 lines
192 B
C

// PR c++/80642
// { dg-do compile { target c++14 } }
int main()
{
[](auto i)
{
if (i)
{
int j;
static int k;
return i + j;
}
return i;
}(0);
}