summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-06-30 14:04:42 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-06-30 14:04:42 +0200
commitce1613ae0d738c6e4148a106c66a33b2f3223c3b (patch)
treea49a4d37c2eb67e6ea4ab1711b33e95111316ef8
parentf9db57dd5bf322382110c8ae1901677c7d88b516 (diff)
Actually print parent name
Change-Id: Iba9bacc0ecaf5288f5c53f6fa73340504c646b4f
-rw-r--r--compilerplugins/clang/refcounting.cxx8
1 files 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();
}
}