https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65549
--- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Lambda functions aren't really nested functions in the tree-nested.c sense, but still are so closely related to the functions they are nested in that IMHO it would be desirable not to split them off into separate partitions, not just temporarily for GCC 5 for debug info reasons. To find out lambdas, I think walking the list of argument types of a function, for each argument type strip of POINTER_TYPE_P and if it is a RECORD_TYPE after stripping those, check if TYPE_CONTEXT of that is some FUNCTION_DECL and in that case try to put the function into the same partition as that other FUNCTION_DECL.