From ce1613ae0d738c6e4148a106c66a33b2f3223c3b Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 30 Jun 2017 14:04:42 +0200 Subject: Actually print parent name Change-Id: Iba9bacc0ecaf5288f5c53f6fa73340504c646b4f --- compilerplugins/clang/refcounting.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/compilerplugins/clang/refcounting.cxx b/compilerplugins/clang/refcounting.cxx index 55eba9bc6217..7585858db85f 100644 --- a/compilerplugins/clang/refcounting.cxx +++ b/compilerplugins/clang/refcounting.cxx @@ -69,7 +69,7 @@ public: } private: void checkUnoReference(QualType qt, const Decl* decl, - const DeclContext* parent, const std::string& rDeclName); + const RecordDecl* parent, const std::string& rDeclName); bool visitTemporaryObjectExpr(Expr const * expr); }; @@ -333,7 +333,7 @@ static bool containsStaticTypeMethod(const CXXRecordDecl* x) return false; } -void RefCounting::checkUnoReference(QualType qt, const Decl* decl, const DeclContext* parent, const std::string& rDeclName) +void RefCounting::checkUnoReference(QualType qt, const Decl* decl, const RecordDecl* parent, const std::string& rDeclName) { if (loplugin::TypeCheck(qt).Class("Reference").Namespace("uno").Namespace("star").Namespace("sun").Namespace("com").GlobalNamespace()) { const CXXRecordDecl* pRecordDecl = qt->getAsCXXRecordDecl(); @@ -347,7 +347,9 @@ void RefCounting::checkUnoReference(QualType qt, const Decl* decl, const DeclCon " contain ::static_type() %1%select{|, parent is %3,}2 should" " probably be using rtl::Reference instead"), decl->getLocation()) - << rDeclName << qt << (parent != nullptr) << parent + << rDeclName << qt << (parent != nullptr) + << (parent != nullptr + ? parent->getQualifiedNameAsString() : std::string()) << decl->getSourceRange(); } } -- cgit v1.2.3