From 687fc1601863ae7a67897bc3590b33bd3bdcc3bc Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 15 Jul 2024 15:17:04 +0200 Subject: [PATCH] lupdate/clang: Fix deprecation warning with llvm 18 Change-Id: Ib22dda34bfdf7a1cd0e9932eec0f6f13a912a688 Reviewed-by: Lucie Gerard --- src/linguist/lupdate/clangtoolastreader.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/linguist/lupdate/clangtoolastreader.cpp b/src/linguist/lupdate/clangtoolastreader.cpp index 6b85c6ccb3..3db9e0d64a 100644 --- a/src/linguist/lupdate/clangtoolastreader.cpp +++ b/src/linguist/lupdate/clangtoolastreader.cpp @@ -782,8 +782,14 @@ bool LupdateVisitor::VisitNamedDecl(clang::NamedDecl *namedDeclaration) if (!fullLocation.isValid() || !fullLocation.getFileEntry()) return true; +#if (LUPDATE_CLANG_VERSION >= LUPDATE_CLANG_VERSION_CHECK(18,0,0)) + auto fileEntry = fullLocation.getFileEntryRef(); + if (fileEntry && !LupdatePrivate::isFileSignificant(fileEntry->getName().str())) + return true; +#else if (!LupdatePrivate::isFileSignificant(fullLocation.getFileEntry()->getName().str())) return true; +#endif qCDebug(lcClang) << "NamedDecl Name: " << QString::fromStdString(namedDeclaration->getQualifiedNameAsString()); qCDebug(lcClang) << "NamedDecl source: " << QString::fromStdString(namedDeclaration->getSourceRange().printToString(