Blame SOURCES/0034-loplugin-unreffun-workaround-for-visibility-adding-r.patch

135360
From daf4c39780b48ee2d9ade4afccd41e3d7efcbeb4 Mon Sep 17 00:00:00 2001
135360
From: Stephan Bergmann <sbergman@redhat.com>
135360
Date: Tue, 9 Jun 2015 12:44:12 +0200
135360
Subject: [PATCH 034/398] loplugin:unreffun: workaround for visibility-adding
135360
 redecls
135360
135360
Change-Id: Ic18b44942f4fe02083c0e8167e8c8d4205e66abf
135360
(cherry picked from commit 623359af236ab8497d4fac34e112a8b9b7b291f2)
135360
---
135360
 compilerplugins/clang/unreffun.cxx | 11 +++++++++++
135360
 1 file changed, 11 insertions(+)
135360
135360
diff --git a/compilerplugins/clang/unreffun.cxx b/compilerplugins/clang/unreffun.cxx
135360
index 3b9c616414b3..5295ca4376b0 100644
135360
--- a/compilerplugins/clang/unreffun.cxx
135360
+++ b/compilerplugins/clang/unreffun.cxx
135360
@@ -87,6 +87,17 @@ bool UnrefFun::VisitFunctionDecl(FunctionDecl const * decl) {
135360
     {
135360
         Decl const * prev = getPreviousNonFriendDecl(decl);
135360
         if (prev != nullptr/* && prev != decl->getPrimaryTemplate()*/) {
135360
+            // Workaround for redeclarations that introduce visiblity attributes
135360
+            // (as is done with
135360
+            //
135360
+            //  SAL_DLLPUBLIC_EXPORT GType lok_doc_view_get_type();
135360
+            //
135360
+            // in libreofficekit/source/gtk/lokdocview.cxx):
135360
+            if (decl->getAttr<VisibilityAttr>() != nullptr
135360
+                && prev->getAttr<VisibilityAttr>() == nullptr)
135360
+            {
135360
+                return true;
135360
+            }
135360
             report(
135360
                 DiagnosticsEngine::Warning,
135360
                 "redundant function%0 redeclaration", decl->getLocation())
135360
-- 
135360
2.12.0
135360