https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108242
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|'__FUNCTION__' was not |'__FUNCTION__' was not |declared when used inside a |declared when used inside a |templated lambda declared |generic (templated) lambda |inside a template function |declared inside a template | |function Known to fail| |11.3.0 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Reduced slightly more: template<int F> void my_fun() { [&](auto) { static constexpr char const* fun_name = __func__; struct t { t() { fun_name; }; } t1; }(12); } int main() { my_fun<1>(); }