Fix compilation problem with latest clang

The change was introduced in the llvm-project repo here:
105c913156

The goal is to be able to pass a nullptr directory
to the LookupFile function if we are not interested
in retrieving the current directory, instead of
creating a dummy variable that is not used after
the function is called.

Fixes #996
This commit is contained in:
Carlos Gálvez 2022-01-28 19:42:17 +01:00 committed by Kim Gräsman
parent ce4ccc665e
commit 6739dcb1c1
1 changed files with 1 additions and 3 deletions

View File

@ -2383,12 +2383,10 @@ class IwyuBaseAstVisitor : public BaseAstVisitor<Derived> {
// that, and is clearly a c++ path, is fine; its exact
// contents don't matter that much.
using clang::Optional;
using clang::DirectoryLookup;
using clang::FileEntryRef;
const FileEntry* use_file = CurrentFileEntry();
const DirectoryLookup* curdir = nullptr;
Optional<FileEntryRef> file = compiler()->getPreprocessor().LookupFile(
CurrentLoc(), "new", true, nullptr, use_file, curdir, nullptr,
CurrentLoc(), "new", true, nullptr, use_file, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, false);
if (file) {
preprocessor_info().FileInfoFor(use_file)->ReportFullSymbolUse(