1// PR c++/55532 2// { dg-do compile { target c++11 } } 3 4struct Foo { 5 void doit() { 6 } 7}; 8 9template<typename T> 10void oops(Foo &foo, const T &) { 11 auto fun = [&] () mutable { 12 foo.doit(); 13 }; 14 auto fun2 = [=]() { 15 fun(); // { dg-error "" } 16 }; 17 fun2(); 18} 19 20int main() { 21 Foo foo; 22 oops(foo, 1); 23} 24