From 7c815274fa95594130d8f66dd5b6931bf3044eca Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@qt.io>
Date: Mon, 12 Mar 2018 13:33:26 +0100
Subject: [PATCH] qdoc: Allow shared comments for global functions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Shared comments were only allowed for functions that
are members of classes. This update extends that
functionality to functions in namespaces, including
the global namespace.

Change-Id: Ida855d8b49c6cdfa1fe900d96af9841e05a87aee
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
---
 src/qdoc/cppcodemarker.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/qdoc/cppcodemarker.cpp b/src/qdoc/cppcodemarker.cpp
index 1667f485b..5e8c3a37b 100644
--- a/src/qdoc/cppcodemarker.cpp
+++ b/src/qdoc/cppcodemarker.cpp
@@ -841,6 +841,13 @@ QList<Section> CppCodeMarker::sections(const Aggregate *inner,
                         }
                     }
                     break;
+                case Node::SharedComment:
+                    {
+                        SharedCommentNode *scn = static_cast<SharedCommentNode *>(*n);
+                        if (!scn->doc().isEmpty())
+                            insert(functions, scn, style, status);
+                    }
+                    break;
                 default:
                     break;
                 }
-- 
GitLab