compilerplugins/clang/includeform.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
New commits: commit 4cc5ceb9e3349fccc8ba08fdacb444ae70c597eb Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Fri Apr 15 20:10:37 2022 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Fri Apr 15 21:05:03 2022 +0200 Adapt to clang::PPCallbacks::InclusionDirective change in Clang 15 trunk <https://github.com/llvm/llvm-project/commit/d79ad2f1dbc2db63121620f55d6cfa915f2733ac> "[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 <sberg...@redhat.com> 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<FileEntryRef> 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)