r368348 - Fix up fd limit diagnosis code

Martin Storsjö via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 9 14:12:35 PDT 2019


Thanks for the fix, Qt does seem to build correctly now again.

// Martin


On Fri, 9 Aug 2019, Reid Kleckner wrote:

> Let me know if the problem persists after r368475. Someone else filed 
> https://bugs.llvm.org/show_bug.cgi?id=42948 as well.
> 
> On Thu, Aug 8, 2019 at 11:34 PM Martin Storsjö <martin at martin.st> wrote:
>       This change broke compiling Qt.
>
>       A repro case looks like this:
>
>       mkdir -p fake-qtincl/5.13.1/QtCore/private
>       touch fake-qtincl/5.13.1/QtCore/private/qglobal_p.h
>       touch fake-qtincl/QtCore
>       echo "#include <QtCore/private/qglobal_p.h>" > qtincl.cpp
>       bin/clang++ -c qtincl.cpp -Ifake-qtincl -Ifake-qtincl/5.13.1
>
>       Previously this ignored the non-directory QtCore, but now clang
>       bails out
>       on it. (And this is code that all other major compilers
>       tolerate, afaik.)
>
>       // Martin
> 
>
>       On Thu, 8 Aug 2019, Reid Kleckner via cfe-commits wrote:
>
>       > Author: rnk
>       > Date: Thu Aug  8 14:35:03 2019
>       > New Revision: 368348
>       >
>       > URL: http://llvm.org/viewvc/llvm-project?rev=368348&view=rev
>       > Log:
>       > 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.
>       >
>       > Modified:
>       >    cfe/trunk/lib/Lex/HeaderSearch.cpp
>       >
>       > Modified: cfe/trunk/lib/Lex/HeaderSearch.cpp
>       > URL:http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/HeaderSearch.cpp?rev=
>       368348&r1=368347&r2=368348&view=diff
>       >===========================================================================
>       ===
>       > --- cfe/trunk/lib/Lex/HeaderSearch.cpp (original)
>       > +++ cfe/trunk/lib/Lex/HeaderSearch.cpp Thu Aug  8 14:35:03
>       2019
>       > @@ -316,8 +316,9 @@ const FileEntry *HeaderSearch::getFileAn
>       >     // message.
>       >     std::error_code EC = File.getError();
>       >     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;
>       >   }
>       >
>       >
>       > _______________________________________________
>       > cfe-commits mailing list
>       > cfe-commits at lists.llvm.org
>       > https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> 
> 
>


More information about the cfe-commits mailing list