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

followup of #649