The attached program simulates a simple reference counted struct. Compiled with "dmd -unittest" both unit tests fail on current DMD HEAD (2.064 dev). This is similar to http://d.puremagic.com/issues/show_bug.cgi?id=10789 but probably has a different root cause.