summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/unreffun.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/compilerplugins/clang/unreffun.cxx b/compilerplugins/clang/unreffun.cxx
index 3b9c616414b3..5295ca4376b0 100644
--- a/compilerplugins/clang/unreffun.cxx
+++ b/compilerplugins/clang/unreffun.cxx
@@ -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())