https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118629
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Of course, __PRETTY_FUNCTION__ isn't in the standard, so we can do whatever we want, but __func__ is said to be implicitly defined in function parameter scope, so at least __func__ in the late return type should be already for the new function or lambda rather than toplevel or the function containing the lambda.