================ @@ -2098,6 +2098,23 @@ OptionalFileEntryRef Preprocessor::LookupHeaderIncludeOrImport( const FileEntry *LookupFromFile, StringRef &LookupFilename, SmallVectorImpl<char> &RelativePath, SmallVectorImpl<char> &SearchPath, ModuleMap::KnownHeader &SuggestedModule, bool isAngled) { + + // Check for trailing whitespace or dots in the include path. + // This must be done before looking up the file, as Windows will still + // find the file even if there are trailing dots or whitespace. + size_t TrailingPos = Filename.find_last_not_of(" ."); + if (TrailingPos != StringRef::npos && TrailingPos < Filename.size() - 1) { + StringRef TrimmedFilename = Filename.rtrim(" ."); + + auto Hint = isAngled ---------------- zmodem wrote:
Since you're providing fixits, it would be nice to have tests for them. Look at clang/test/Parser/extra-semi.cpp for an example. https://github.com/llvm/llvm-project/pull/96960 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits