view gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv8.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

// PR c++/56447
// { dg-do compile { target c++11 } }

template <class T>
void f()
{
  int i;
  // This lambda should not have a conversion op, since it captures i
  int (*p)() = [=]{ return i; }; // { dg-error "cannot convert" }
}

int main()
{
  f<int>();
}