diff options
author | Björn Schäpers <bjoern@hazardy.de> | 2022-10-01 07:19:52 +0200 |
---|---|---|
committer | Björn Schäpers <bjoern@hazardy.de> | 2022-10-06 13:58:20 +0200 |
commit | 6495329e6de803025e6e4e8291b648f94893551c (patch) | |
tree | 5d332b867631e5dd7dd6016078fe7c591f2b34bc /src/linguist | |
parent | cfa6ee89f38668bf8ac889a06977abeb1853bbe4 (diff) | |
download | qttools-6495329e6de803025e6e4e8291b648f94893551c.tar.gz |
lupdate: Fix build with clang 15+
The signature of InclusionDirective changed for clang 15.
Pick-to: 6.4
Change-Id: Ic259b3508088671b40f6f615524137ce8837c487
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/linguist')
-rw-r--r-- | src/linguist/lupdate/lupdatepreprocessoraction.cpp | 13 | ||||
-rw-r--r-- | src/linguist/lupdate/lupdatepreprocessoraction.h | 7 |
2 files changed, 17 insertions, 3 deletions
diff --git a/src/linguist/lupdate/lupdatepreprocessoraction.cpp b/src/linguist/lupdate/lupdatepreprocessoraction.cpp index abfab34e5..d963747d8 100644 --- a/src/linguist/lupdate/lupdatepreprocessoraction.cpp +++ b/src/linguist/lupdate/lupdatepreprocessoraction.cpp @@ -156,14 +156,23 @@ void LupdatePPCallbacks::SourceRangeSkipped(clang::SourceRange sourceRange, // To list the included files void LupdatePPCallbacks::InclusionDirective(clang::SourceLocation /*hashLoc*/, const clang::Token & /*includeTok*/, clang::StringRef /*fileName*/, bool /*isAngled*/, - clang::CharSourceRange /*filenameRange*/, const clang::FileEntry *file, + clang::CharSourceRange /*filenameRange*/, +#if (LUPDATE_CLANG_VERSION >= LUPDATE_CLANG_VERSION_CHECK(15,0,0)) + const clang::Optional<clang::FileEntryRef> file, +#else + const clang::FileEntry *file, +#endif clang::StringRef /*searchPath*/, clang::StringRef /*relativePath*/, const clang::Module */*imported*/, clang::SrcMgr::CharacteristicKind /*fileType*/) { if (!file) return; - clang::StringRef fileNameRealPath = file->tryGetRealPathName(); + clang::StringRef fileNameRealPath = file-> +#if (LUPDATE_CLANG_VERSION >= LUPDATE_CLANG_VERSION_CHECK(15,0,0)) + getFileEntry(). +#endif + tryGetRealPathName(); if (!LupdatePrivate::isFileSignificant(fileNameRealPath.str())) return; diff --git a/src/linguist/lupdate/lupdatepreprocessoraction.h b/src/linguist/lupdate/lupdatepreprocessoraction.h index b1ee468d4..3e44cee83 100644 --- a/src/linguist/lupdate/lupdatepreprocessoraction.h +++ b/src/linguist/lupdate/lupdatepreprocessoraction.h @@ -51,7 +51,12 @@ private: void SourceRangeSkipped(clang::SourceRange sourceRange, clang::SourceLocation endifLoc) override; void InclusionDirective(clang::SourceLocation /*hashLoc*/, const clang::Token &/*includeTok*/, clang::StringRef /*fileName*/, bool /*isAngled*/, - clang::CharSourceRange /*filenameRange*/, const clang::FileEntry *file, + clang::CharSourceRange /*filenameRange*/, +#if (LUPDATE_CLANG_VERSION >= LUPDATE_CLANG_VERSION_CHECK(15,0,0)) + const clang::Optional<clang::FileEntryRef> file, +#else + const clang::FileEntry *file, +#endif clang::StringRef /*searchPath*/, clang::StringRef /*relativePath*/, const clang::Module */*imported*/, clang::SrcMgr::CharacteristicKind /*fileType*/) override; |