Skip to content

Commit

Permalink
lupdate/clang: Fix deprecation warning with llvm 18
Browse files Browse the repository at this point in the history
Change-Id: Ib22dda34bfdf7a1cd0e9932eec0f6f13a912a688
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
  • Loading branch information
jobor committed Jul 16, 2024
1 parent a404ed4 commit 687fc16
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/linguist/lupdate/clangtoolastreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 687fc16

Please sign in to comment.