Index: COFF/Driver.cpp =================================================================== --- COFF/Driver.cpp +++ COFF/Driver.cpp @@ -572,6 +572,8 @@ if ((*OldBuf)->getBuffer() != NewBuf->getBuffer()) { OldBuf->reset(); HandleError(errorCodeToError(sys::fs::rename(TmpName, Path))); + } else { + sys::fs::remove(TmpName); } }