https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83739
--- Comment #6 from Marc Glisse <glisse at gcc dot gnu.org> --- Without fancy tools, looking at the last few lines of the file: #include <set> template <bool> void f() { std::set<unsigned> x; auto delegate = [](auto & foo) { for (auto bar : foo); }; delegate(x); } int main() { f<true>(); }