// PR c++/61151 // { dg-do compile { target c++11 } } struct B { void foo () {} }; template struct A { template void bar (); B a; }; template template void A::bar () { auto f = [this] () { auto g = [=] () { a.foo (); }; g (); }; // { dg-warning "implicit capture" "" { target c++2a } } f (); } int main () { A a; a.bar (); }