Skip to content

Commit 5ed1adf

Browse files
Axel-Naumannhahnjo
authored andcommitted
survive -Inon-accessible-directory:
If part of the -I search path cannot be accessed (permissions), clang will throw an error, even if the header can be found in subsequent search path elements. This is counter productive as the compilation will seem to have failed due to that error, even though everyone is happy. This is not the sys first error that needs to be suppressed, and it might not be the last...
1 parent 01400e9 commit 5ed1adf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clang/lib/Lex/HeaderSearch.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,9 @@ OptionalFileEntryRef HeaderSearch::getFileAndSuggestModule(
426426
std::error_code EC = llvm::errorToErrorCode(File.takeError());
427427
if (EC != llvm::errc::no_such_file_or_directory &&
428428
EC != llvm::errc::invalid_argument &&
429-
EC != llvm::errc::is_a_directory && EC != llvm::errc::not_a_directory) {
429+
EC != llvm::errc::is_a_directory &&
430+
EC != llvm::errc::not_a_directory &&
431+
EC != llvm::errc::permission_denied) {
430432
Diags.Report(IncludeLoc, diag::err_cannot_open_file)
431433
<< FileName << EC.message();
432434
}

0 commit comments

Comments
 (0)