8sa1-gcc/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice23.C
Paolo Carlini 5625e74790 re PR c++/84618 (ICE in build_capture_proxy, at cp/lambda.c:460)
/cp
2018-03-05  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/84618
	* parser.c (cp_parser_lambda_introducer): Reject any capture not
	involving a VAR_DECL or a PARM_DECL.

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

	PR c++/84618
	* g++.dg/cpp0x/lambda/lambda-ice29.C: New.
	* g++.dg/cpp0x/lambda/lambda-ice17.C: Adjust.
	* g++.dg/cpp0x/lambda/lambda-ice23.C: Likewise.

From-SVN: r258250
2018-03-05 15:40:15 +00:00

14 lines
220 B
C

// PR c++/59991
// { dg-do compile { target c++11 } }
template <typename T>
constexpr int r(T x) {
auto f = [r,x]() { return r(x); }; // { dg-error "13:capture of non-variable" }
return 0;
}
int main()
{
r(0);
}