/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
14 lines
220 B
C
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);
|
|
}
|