From 4b0afe968ed62ac65d5f04918f4cda501ecf1619 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 9 Oct 2019 14:25:36 +0200 Subject: Improve loplugin:redundantpointerops diagnostic messages Change-Id: If09f5c916f2db98c5d1754d2fbc8f53c502799c9 Reviewed-on: https://gerrit.libreoffice.org/80543 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- compilerplugins/clang/compat.hxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'compilerplugins/clang/compat.hxx') diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx index cb13f44cfa66..c091c51601f7 100644 --- a/compilerplugins/clang/compat.hxx +++ b/compilerplugins/clang/compat.hxx @@ -240,6 +240,19 @@ inline const clang::Expr *getSubExprAsWritten(const clang::CastExpr *This) { return getSubExprAsWritten(const_cast(This)); } +inline clang::QualType getObjectType(clang::CXXMemberCallExpr const * expr) { +#if CLANG_VERSION >= 100000 + return expr->getObjectType(); +#else + // + // "[OpenCL] Improve destructor support in C++ for OpenCL": + clang::QualType Ty = expr->getImplicitObjectArgument()->getType(); + if (Ty->isPointerType()) + Ty = Ty->getPointeeType(); + return Ty; +#endif +} + inline bool isExplicitSpecified(clang::CXXConstructorDecl const * decl) { #if CLANG_VERSION >= 90000 return decl->getExplicitSpecifier().isExplicit(); -- cgit