From 4cc5ceb9e3349fccc8ba08fdacb444ae70c597eb Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 15 Apr 2022 20:10:37 +0200 Subject: [PATCH] Adapt to clang::PPCallbacks::InclusionDirective change in Clang 15 trunk "[clang][lex] NFCI: Use FileEntryRef in PPCallbacks::InclusionDirective()" Change-Id: Ib2ea325cca3be03d3b5dfb9dfc3d870be659b129 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133085 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- compilerplugins/clang/includeform.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/compilerplugins/clang/includeform.cxx b/compilerplugins/clang/includeform.cxx index d9e603351783..7b2c0feb07ea 100644 --- a/compilerplugins/clang/includeform.cxx +++ b/compilerplugins/clang/includeform.cxx @@ -28,13 +28,18 @@ private: void InclusionDirective( SourceLocation HashLoc, Token const & IncludeTok, StringRef, - bool IsAngled, CharSourceRange FilenameRange, FileEntry const * File, + bool IsAngled, CharSourceRange FilenameRange, +#if CLANG_VERSION >= 150000 + Optional File, +#else + FileEntry const * File, +#endif StringRef SearchPath, StringRef, clang::Module const *, SrcMgr::CharacteristicKind) override { if (ignoreLocation(HashLoc)) { return; } - if (File == nullptr) { // in case of "fatal error: '...' file not found" + if (!File) { // in case of "fatal error: '...' file not found" return; } if (IncludeTok.getIdentifierInfo()->getPPKeywordID() != tok::pp_include)