pfultz2 added a comment. Is it possible to add a test like this? kernel<<<1,1>>>([=](){ auto f = [&]{ hd(); }; f(); }); That should not have a compiler error. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78655/new/ https://reviews.llvm.org/D78655