compilerplugins/clang/compat.hxx | 10 ++++++++++ compilerplugins/clang/stringconstant.cxx | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-)
New commits: commit 22fb58a6fa7764ec0045529c483693e1a81b488e Author: Michael Stahl <mst...@redhat.com> Date: Fri Nov 6 14:23:56 2015 +0100 compilerplugins: getAsTagDecl doesn't exist in clang 3.5 Change-Id: If7277820227486e2eb578a167e0fd9f05c8f74ae Reviewed-on: https://gerrit.libreoffice.org/19823 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Michael Stahl <mst...@redhat.com> diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx index 0ca37fa..6b14510 100644 --- a/compilerplugins/clang/compat.hxx +++ b/compilerplugins/clang/compat.hxx @@ -255,6 +255,16 @@ inline bool isMacroBodyExpansion(clang::CompilerInstance& compiler, clang::Sourc #endif } +inline auto getAsTagDecl(clang::Type const& t) -> clang::TagDecl * +{ +#if (__clang_major__ == 3 && __clang_minor__ > 5) || __clang_major__ > 3 + // TODO not sure if it works with clang 3.6, trunk is known to work + return t.getAsTagDecl(); +#else + return t.getAs<clang::TagType>()->getDecl(); +#endif +} + } #endif diff --git a/compilerplugins/clang/stringconstant.cxx b/compilerplugins/clang/stringconstant.cxx index 8fbed25..56ae27c 100644 --- a/compilerplugins/clang/stringconstant.cxx +++ b/compilerplugins/clang/stringconstant.cxx @@ -235,7 +235,7 @@ bool StringConstant::VisitCallExpr(CallExpr const * expr) { && t->isClassType() && t->getAs<SubstTemplateTypeParmType>() == nullptr) { - auto td = t->getAsTagDecl(); + auto td = compat::getAsTagDecl(*t); auto id = td->getIdentifier(); if (id != nullptr && id->isStr("OUString")) { auto nd = dyn_cast<NamespaceDecl>(td->getParent()); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits