https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109108
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Iain Buclaw <ibuc...@gcc.gnu.org>: https://gcc.gnu.org/g:bd109dee471aa83f2397a6b56d074583c48475c7 commit r11-10575-gbd109dee471aa83f2397a6b56d074583c48475c7 Author: Iain Buclaw <ibuc...@gdcproject.org> Date: Tue Mar 14 13:16:11 2023 +0100 d: Fix undefined reference to lambda defined in private enum [PR109108] Previously lambdas were connected to the module they were defined in. Now they are emitted into every referencing compilation unit, and are given one-only linkage. PR d/109108 gcc/d/ChangeLog: * decl.cc (get_symbol_decl): Set DECL_LAMBDA_FUNCTION_P on function literals. (start_function): Unconditionally unset DECL_EXTERNAL. (set_linkage_for_decl): Give lambda functions one-only linkage. gcc/testsuite/ChangeLog: * gdc.dg/torture/torture.exp (srcdir): New proc. * gdc.dg/torture/imports/pr109108.d: New test. * gdc.dg/torture/pr109108.d: New test. (cherry picked from commit 423d34f61c43e400f0d5b837fe93c83963b2ecdd)