瀏覽代碼

Fix up fd limit diagnosis code

Apparently Windows returns the "invalid argument" error code when the
path contains invalid characters such as '<'. The
test/Preprocessor/include-likely-typo.c test does this, so it was
failing after r368322.

Also, the diagnostic requires two arguments, so add the filename.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@368348 91177308-0d34-0410-b5e6-96231b3b80d8
Reid Kleckner 6 年之前
父節點
當前提交
15d6d81960
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      lib/Lex/HeaderSearch.cpp

+ 3 - 2
lib/Lex/HeaderSearch.cpp

@@ -316,8 +316,9 @@ const FileEntry *HeaderSearch::getFileAndSuggestModule(
     // message.
     // message.
     std::error_code EC = File.getError();
     std::error_code EC = File.getError();
     if (EC != std::errc::no_such_file_or_directory &&
     if (EC != std::errc::no_such_file_or_directory &&
-        EC != std::errc::is_a_directory) {
-      Diags.Report(IncludeLoc, diag::err_cannot_open_file) << EC.message();
+        EC != std::errc::invalid_argument && EC != std::errc::is_a_directory) {
+      Diags.Report(IncludeLoc, diag::err_cannot_open_file)
+          << FileName << EC.message();
     }
     }
     return nullptr;
     return nullptr;
   }
   }