https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103040
--- Comment #15 from Iain Buclaw <ibuclaw at gdcproject dot org> --- Got it. The difference between D and C++ is a matter of early inlining. The C++ example Jakub posted fails in the same way that D does if you compile with: -O1 -fno-inline