https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96157
--- Comment #2 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:312ad889e99ff9458c01518325775e75ab57f272 commit r11-2863-g312ad889e99ff9458c01518325775e75ab57f272 Author: Iain Buclaw <ibuc...@gdcproject.org> Date: Tue Aug 25 00:39:17 2020 +0200 d: Fix no NRVO when returning an array of a non-POD struct TREE_ADDRESSABLE was not propagated from the RECORD_TYPE to the ARRAY_TYPE, so NRVO code generation was not being triggered. gcc/d/ChangeLog: PR d/96157 * d-codegen.cc (d_build_call): Handle TREE_ADDRESSABLE static arrays. * types.cc (make_array_type): Propagate TREE_ADDRESSABLE from base type to static array. gcc/testsuite/ChangeLog: PR d/96157 * gdc.dg/pr96157a.d: New test. * gdc.dg/pr96157b.d: New test.