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

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