compilerplugins: getAsTagDecl doesn't exist in clang 3.5
Change-Id: If7277820227486e2eb578a167e0fd9f05c8f74ae Reviewed-on: https://gerrit.libreoffice.org/19823 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
This commit is contained in:
@@ -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
|
||||
|
@@ -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());
|
||||
|
Reference in New Issue
Block a user