| 1 |
// PR c++/56447 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
template <class T> |
| 5 |
void f() |
| 6 |
{ |
| 7 |
int i; |
| 8 |
// This lambda should not have a conversion op, since it captures i |
| 9 |
int (*p)() = [=]{ return i; }; // { dg-error "cannot convert" } |
| 10 |
} |
| 11 |
|
| 12 |
int main() |
| 13 |
{ |
| 14 |
f<int>(); |
| 15 |
} |