1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// PR c++/54276 // { dg-do link { target c++11 } } template <typename T> void foo(T) { static int x = 1; auto f = [] { return x + 1; }; f(); } int main() { foo(4); }