summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/compat.hxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-10-09 23:25:02 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-10-10 08:41:06 +0200
commitc874294ad9fb178df47c66875bfbdec466e39763 (patch)
tree971d04af65ad062001134009dd5a0c49a48e90d0 /compilerplugins/clang/compat.hxx
parent4c9cf046be055affee94a533f9db67f6fb0702cb (diff)
Fix detection of std::unique_ptr/shared_ptr in loplugin:redundantpointerops
...when the get member function is implemented in a base class, as happens for std::shared_ptr in libstdc++ (where it is implemented in base __shared_ptr; see also 7d361e96c9ea822790db21806e9fc05279423833 "loplugin:redundantpointerops"). And while at it, check for precisely the classes we are interested in (for which we know the semantics of get and operator*), rather than any classes whose unqualified names happen to match. Change-Id: I0c85ba46f191a2ee038c8175d979aa0c1be765cd Reviewed-on: https://gerrit.libreoffice.org/80585 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins/clang/compat.hxx')
-rw-r--r--compilerplugins/clang/compat.hxx13
1 files changed, 0 insertions, 13 deletions
diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx
index c091c51601f7..cb13f44cfa66 100644
--- a/compilerplugins/clang/compat.hxx
+++ b/compilerplugins/clang/compat.hxx
@@ -240,19 +240,6 @@ inline const clang::Expr *getSubExprAsWritten(const clang::CastExpr *This) {
return getSubExprAsWritten(const_cast<clang::CastExpr *>(This));
}
-inline clang::QualType getObjectType(clang::CXXMemberCallExpr const * expr) {
-#if CLANG_VERSION >= 100000
- return expr->getObjectType();
-#else
- // <https://github.com/llvm/llvm-project/commit/88559637641e993895337e1047a0bd787fecc647>
- // "[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();