Add changes from D-Programming-Language/dmd#3685
Merge pull request #650 from Trass3r/dmdpr3685

Add changes from D-Programming-Language/dmd#3685