summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 66c79d0e9e4..a2872dd4f20 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -535,7 +535,8 @@ CompilerInstance::createOutputFile(StringRef OutputPath,
bool Exists;
if ((CreateMissingDirectories || ParentExists) &&
((llvm::sys::fs::exists(AbsPath.str(), Exists) || !Exists) ||
- (OutPath.isRegularFile() && OutPath.canWrite()))) {
+ (OutPath.isRegularFile() &&
+ llvm::sys::fs::can_write(AbsPath.c_str())))) {
// Create a temporary file.
SmallString<128> TempPath;
TempPath = OutFile;
OpenPOWER on IntegriCloud