compilerplugins/clang/compat.hxx | 9 +++++++++ compilerplugins/clang/cstylecast.cxx | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-)
New commits: commit 5f0e243159cae738dee65303f61b5a5f1b3bdf28 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Wed Nov 1 16:46:43 2023 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Thu Nov 2 07:46:28 2023 +0100 Adapt to Clang 18 trunk ElaboratedTypeKeyword rework <https://github.com/llvm/llvm-project/commit/4ad2ada5216ee2bb3c334a3233a9ab51f2521b82> "[clang][NFC] Refactor ElaboratedTypeKeyword" Change-Id: I1ee6592fe76bb484441ca859986e7217eaba58f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158764 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx index a836aa0af1ed..650d187070e0 100644 --- a/compilerplugins/clang/compat.hxx +++ b/compilerplugins/clang/compat.hxx @@ -82,6 +82,15 @@ constexpr clang::ExprValueKind VK_PRValue = clang::VK_PRValue; constexpr clang::ExprValueKind VK_PRValue = clang::VK_RValue; #endif +namespace ElabortatedTypeKeyword +{ +#if CLANG_VERSION >= 180000 +constexpr clang::ElaboratedTypeKeyword None = clang::ElaboratedTypeKeyword::None; +#else +constexpr clang::ElaboratedTypeKeyword None = clang::ETK_None; +#endif +} + inline bool EvaluateAsInt(clang::Expr const * expr, llvm::APSInt& intRes, const clang::ASTContext& ctx) { clang::Expr::EvalResult res; bool b = expr->EvaluateAsInt(res, ctx); diff --git a/compilerplugins/clang/cstylecast.cxx b/compilerplugins/clang/cstylecast.cxx index 35292ecd8fb6..2360606aff55 100644 --- a/compilerplugins/clang/cstylecast.cxx +++ b/compilerplugins/clang/cstylecast.cxx @@ -161,7 +161,7 @@ bool canBeUsedForFunctionalCast(TypeSourceInfo const * info) { return true; } if (auto const t = dyn_cast<ElaboratedType>(type)) { - return t->getKeyword() == ETK_None; + return t->getKeyword() == compat::ElabortatedTypeKeyword::None; } return false; }