1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
// PR c++/56901 // { dg-require-effective-target c++11 } template <typename> void foo_impl() { int data; auto L = [&](){ return data; }; [&](){ L(); }(); [&L](){ L(); }(); } void foo() { foo_impl<int>(); }