https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109108
--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Iain Buclaw <ibuc...@gcc.gnu.org>: https://gcc.gnu.org/g:423d34f61c43e400f0d5b837fe93c83963b2ecdd commit r13-6668-g423d34f61c43e400f0d5b837fe93c83963b2ecdd 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 (function_defined_in_root_p): Remove. (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/imports/pr109108.d: New test. * gdc.dg/torture/pr109108.d: New test.