// PR c++/64496 // { dg-do compile { target c++11 } } template class B; template struct B { template B(F); }; template template B::B(F) {} int main() { int a; struct A // { dg-message "lambda in local class" } { B l = [=] { a; // { dg-error "not captured" } }; }; [] { // { dg-message "capture-default" } a; // { dg-error "not captured" } }; A t; }