https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109144
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Iain Buclaw <ibuc...@gcc.gnu.org>: https://gcc.gnu.org/g:2ca6dba641fa56ce70c3e1c78729389b3ed40076 commit r12-9269-g2ca6dba641fa56ce70c3e1c78729389b3ed40076 Author: Iain Buclaw <ibuc...@gdcproject.org> Date: Thu Mar 16 01:07:02 2023 +0100 d: Fix closure fields don't get same alignment as local variable [PR109144] Local variables with both non-local references and explicit alignment did not propagate their alignment to either the closure field or closure frame type, resulting in the closure being misaligned. This is now correctly set-up when building the frame type. PR d/109144 gcc/d/ChangeLog: * d-codegen.cc (build_frame_type): Set frame field and type alignment. gcc/testsuite/ChangeLog: * gdc.dg/torture/pr109144.d: New test. (cherry picked from commit 46c4be98d1e759a406069487e5dbaad0346e7e7d)