Kaydet (Commit) 623359af authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:unreffun: workaround for visibility-adding redecls

Change-Id: Ic18b44942f4fe02083c0e8167e8c8d4205e66abf
üst 46a76be3
......@@ -87,6 +87,17 @@ bool UnrefFun::VisitFunctionDecl(FunctionDecl const * decl) {
{
Decl const * prev = getPreviousNonFriendDecl(decl);
if (prev != nullptr/* && prev != decl->getPrimaryTemplate()*/) {
// Workaround for redeclarations that introduce visiblity attributes
// (as is done with
//
// SAL_DLLPUBLIC_EXPORT GType lok_doc_view_get_type();
//
// in libreofficekit/source/gtk/lokdocview.cxx):
if (decl->getAttr<VisibilityAttr>() != nullptr
&& prev->getAttr<VisibilityAttr>() == nullptr)
{
return true;
}
report(
DiagnosticsEngine::Warning,
"redundant function%0 redeclaration", decl->getLocation())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment