This is not portably unit-testable because the only visible
effect is a change from one random message string to another.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247900
91177308-0d34-0410-b5e6-
96231b3b80d8
llvm::sys::fs::status(OutputPath, Status);
if (llvm::sys::fs::exists(Status)) {
// Fail early if we can't write to the final destination.
- if (!llvm::sys::fs::can_write(OutputPath))
+ if (!llvm::sys::fs::can_write(OutputPath)) {
+ Error = std::make_error_code(std::errc::operation_not_permitted);
return nullptr;
+ }
// Don't use a temporary if the output is a special file. This handles
// things like '-o /dev/null'