summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2021-08-20 18:01:02 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-08-23 13:15:32 +0000
commit0132833445029121953fd8633244e308900a9386 (patch)
treeda0fab8ba78caf719643b6da7cdb8c564dc45b45
parentbe1c22d98d9b70cd28d17c75bb54799b519cac20 (diff)
qdoc: Improve function tagging for grouped \fn commands
QDoc provides a mechanism for tagging specific function declarations in a header with //! [tag] comments, allowing these tags to be referenced in an \fn command. This feature did not work for shared comment nodes containing multiple \fn commands, however. To make this work, we need to associate the 'bracketed args' (where the id tag is) with the command itself - previously it was stored in the Doc instance, but that doesn't work when there are multiple topic commands sharing a doc. To do so, repurpose the ArgLocPair structure to store the bracketed arg instead of a Location, as we never used this particular Location for anything, anyway. Fixes: QTBUG-95948 Change-Id: Ic899d4252d705f84ba56ea201a55f3e5db068f00 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 76fb767296e12235d93da683a7f2feb84a7a6675) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/qdoc/cppcodeparser.cpp15
-rw-r--r--src/qdoc/cppcodeparser.h4
-rw-r--r--src/qdoc/doc.cpp25
-rw-r--r--src/qdoc/doc.h5
-rw-r--r--src/qdoc/docparser.cpp11
-rw-r--r--src/qdoc/docprivate.h2
-rw-r--r--src/qdoc/qmlvisitor.cpp4
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml5
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/dontdocument/dontdocument.qhp2
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml6
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index2
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/scopedenum-docbook/testqdoc-test.xml5
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/test.qhp2
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/testcpp.index2
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test-obsolete.html43
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags14
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp6
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h6
-rw-r--r--tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp1
19 files changed, 127 insertions, 33 deletions
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp
index 26309194e..bf155c520 100644
--- a/src/qdoc/cppcodeparser.cpp
+++ b/src/qdoc/cppcodeparser.cpp
@@ -188,7 +188,7 @@ const QSet<QString> &CppCodeParser::topicCommands()
Process the topic \a command found in the \a doc with argument \a arg.
*/
Node *CppCodeParser::processTopicCommand(const Doc &doc, const QString &command,
- const ArgLocPair &arg)
+ const ArgPair &arg)
{
ExtraFuncData extra;
if (command == COMMAND_FN) {
@@ -496,9 +496,9 @@ const QSet<QString> &CppCodeParser::metaCommands()
\a node is guaranteed to be non-null.
*/
void CppCodeParser::processMetaCommand(const Doc &doc, const QString &command,
- const ArgLocPair &argLocPair, Node *node)
+ const ArgPair &argPair, Node *node)
{
- QString arg = argLocPair.first;
+ QString arg = argPair.first;
if (command == COMMAND_INHEADERFILE) {
if (node->isAggregate())
static_cast<Aggregate *>(node)->addIncludeFile(arg);
@@ -624,8 +624,8 @@ void CppCodeParser::processMetaCommand(const Doc &doc, const QString &command,
node->setAbstract(true);
} else if (command == COMMAND_DEPRECATED) {
node->setStatus(Node::Deprecated);
- if (const QString version = doc.bracketedArgs(command); !version.isEmpty())
- node->setDeprecatedSince(version);
+ if (!argPair.second.isEmpty())
+ node->setDeprecatedSince(argPair.second);
} else if (command == COMMAND_INGROUP || command == COMMAND_INPUBLICGROUP) {
// Note: \ingroup and \inpublicgroup are the same (and now recognized as such).
m_qdb->addToGroup(arg, node);
@@ -915,7 +915,7 @@ void CppCodeParser::processTopicArgs(const Doc &doc, const QString &topic, NodeL
if (args.size() == 1) {
if (topic == COMMAND_FN) {
if (showInternal() || !doc.isInternal())
- node = parserForLanguage("Clang")->parseFnArg(doc.location(), args[0].first, doc.bracketedArgs(topic));
+ node = parserForLanguage("Clang")->parseFnArg(doc.location(), args[0].first, args[0].second);
} else if (topic == COMMAND_MACRO) {
node = parseMacroArg(doc.location(), args[0].first);
} else if (isQMLMethodTopic(topic) || isJSMethodTopic(topic)) {
@@ -935,7 +935,7 @@ void CppCodeParser::processTopicArgs(const Doc &doc, const QString &topic, NodeL
node = nullptr;
if (topic == COMMAND_FN) {
if (showInternal() || !doc.isInternal())
- node = parserForLanguage("Clang")->parseFnArg(doc.location(), arg.first); // TODO: Ensure \fn commands sharing a comment can have individual bracketed args
+ node = parserForLanguage("Clang")->parseFnArg(doc.location(), arg.first, arg.second);
} else if (topic == COMMAND_MACRO) {
node = parseMacroArg(doc.location(), arg.first);
} else if (isQMLMethodTopic(topic) || isJSMethodTopic(topic)) {
@@ -958,6 +958,7 @@ void CppCodeParser::processTopicArgs(const Doc &doc, const QString &topic, NodeL
nodes.append(scn);
docs.append(doc);
}
+ processMetaCommands(doc, node);
}
}
for (auto *scn : sharedCommentNodes)
diff --git a/src/qdoc/cppcodeparser.h b/src/qdoc/cppcodeparser.h
index 62ace0b91..e14ce9b3d 100644
--- a/src/qdoc/cppcodeparser.h
+++ b/src/qdoc/cppcodeparser.h
@@ -69,11 +69,11 @@ protected:
static const QSet<QString> &topicCommands();
static const QSet<QString> &metaCommands();
virtual Node *processTopicCommand(const Doc &doc, const QString &command,
- const ArgLocPair &arg);
+ const ArgPair &arg);
void processQmlProperties(const Doc &doc, NodeList &nodes, DocList &docs);
bool splitQmlPropertyArg(const QString &arg, QString &type, QString &module, QString &element,
QString &name, const Location &location);
- void processMetaCommand(const Doc &doc, const QString &command, const ArgLocPair &argLocPair,
+ void processMetaCommand(const Doc &doc, const QString &command, const ArgPair &argLocPair,
Node *node);
void processMetaCommands(const Doc &doc, Node *node);
void processMetaCommands(NodeList &nodes, DocList &docs);
diff --git a/src/qdoc/doc.cpp b/src/qdoc/doc.cpp
index cff32b4e3..4a4c90357 100644
--- a/src/qdoc/doc.cpp
+++ b/src/qdoc/doc.cpp
@@ -43,6 +43,20 @@ QT_BEGIN_NAMESPACE
DocUtilities &Doc::m_utilities = DocUtilities::instance();
/*!
+ \typedef ArgList
+ \relates Doc
+
+ A list of metacommand arguments that appear in a Doc. Each entry
+ in the list is a <QString, QString> pair (ArgPair):
+
+ \list
+ \li \c {ArgPair.first} - arguments passed to the command.
+ \li \c {ArgPair.second} - optional argument string passed
+ within brackets immediately following the command.
+ \endlist
+*/
+
+/*!
Parse the qdoc comment \a source. Build up a list of all the topic
commands found including their arguments. This constructor is used
when there can be more than one topic command in theqdoc comment.
@@ -500,15 +514,4 @@ void Doc::detach()
m_priv = newPriv;
}
-/*!
- Returns the argument passed in square brackets to the command \a command,
- if it exists.
- */
-QString Doc::bracketedArgs(const QString &command) const
-{
- if (m_priv && m_priv->extra && !m_priv->extra->m_bracketedArgs.isEmpty())
- return m_priv->extra->m_bracketedArgs[command];
- return QString();
-}
-
QT_END_NAMESPACE
diff --git a/src/qdoc/doc.h b/src/qdoc/doc.h
index 3862bdcc8..8008025c7 100644
--- a/src/qdoc/doc.h
+++ b/src/qdoc/doc.h
@@ -46,8 +46,8 @@ class DocPrivate;
class Quoter;
class Text;
-typedef QPair<QString, Location> ArgLocPair;
-typedef QList<ArgLocPair> ArgList;
+typedef QPair<QString, QString> ArgPair;
+typedef QList<ArgPair> ArgList;
typedef QMultiMap<QString, QString> QStringMultiMap;
class Doc
@@ -95,7 +95,6 @@ public:
[[nodiscard]] const QList<Atom *> &keywords() const;
[[nodiscard]] const QList<Atom *> &targets() const;
[[nodiscard]] QStringMultiMap *metaTagMap() const;
- [[nodiscard]] QString bracketedArgs(const QString &command) const;
static void initialize();
static void terminate();
diff --git a/src/qdoc/docparser.cpp b/src/qdoc/docparser.cpp
index 4a84020f7..814c5fee6 100644
--- a/src/qdoc/docparser.cpp
+++ b/src/qdoc/docparser.cpp
@@ -1101,16 +1101,15 @@ void DocParser::parse(const QString &source, DocPrivate *docPrivate,
append(Atom::ParaRight);
p1 = getMetaCommandArgument(cmdStr);
}
- m_private->m_metaCommandMap[cmdStr].append(ArgLocPair(p1, location()));
+ m_private->m_metaCommandMap[cmdStr].append(ArgPair(p1, QString()));
break;
case NOT_A_CMD:
if (metaCommandSet.contains(cmdStr)) {
QString arg;
+ QString bracketedArg;
m_private->m_metacommandsUsed.insert(cmdStr);
- if (isLeftBracketAhead()) {
- m_private->constructExtra();
- m_private->extra->m_bracketedArgs[cmdStr] = getBracketedArgument();
- }
+ if (isLeftBracketAhead())
+ bracketedArg = getBracketedArgument();
// Force a linebreak after \obsolete or \deprecated
// to treat potential arguments as a new text paragraph.
if (m_position < m_inputLength
@@ -1119,7 +1118,7 @@ void DocParser::parse(const QString &source, DocPrivate *docPrivate,
m_input[m_position] = '\n';
else
arg = getMetaCommandArgument(cmdStr);
- m_private->m_metaCommandMap[cmdStr].append(ArgLocPair(arg, location()));
+ m_private->m_metaCommandMap[cmdStr].append(ArgPair(arg, bracketedArg));
if (possibleTopics.contains(cmdStr)) {
if (!cmdStr.endsWith(QLatin1String("propertygroup")))
m_private->m_topics.append(Topic(cmdStr, arg));
diff --git a/src/qdoc/docprivate.h b/src/qdoc/docprivate.h
index d3db5219f..edd63a6fe 100644
--- a/src/qdoc/docprivate.h
+++ b/src/qdoc/docprivate.h
@@ -53,7 +53,6 @@
QT_BEGIN_NAMESPACE
-typedef QPair<QString, Location> ArgLocPair;
typedef QMap<QString, ArgList> CommandMap;
struct DocPrivateExtra
@@ -63,7 +62,6 @@ struct DocPrivateExtra
QList<Atom *> m_keywords {};
QList<Atom *> m_targets {};
QStringMultiMap m_metaMap {};
- QMap<QString, QString> m_bracketedArgs {};
};
class DocPrivate
diff --git a/src/qdoc/qmlvisitor.cpp b/src/qdoc/qmlvisitor.cpp
index 5f7edde35..9c46ac661 100644
--- a/src/qdoc/qmlvisitor.cpp
+++ b/src/qdoc/qmlvisitor.cpp
@@ -424,8 +424,8 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::SourceLocation, Node *node, Doc &d
}
} else if (command == COMMAND_DEPRECATED) {
node->setStatus(Node::Deprecated);
- if (const QString version = doc.bracketedArgs(command); !version.isEmpty())
- node->setDeprecatedSince(version);
+ if (!args[0].second.isEmpty())
+ node->setDeprecatedSince(args[0].second);
} else if ((command == COMMAND_INQMLMODULE) || (command == COMMAND_INJSMODULE)) {
qdb->addToQmlModule(args[0].first, node);
} else if (command == COMMAND_QMLINHERITS) {
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml
index f74a0a992..c4593d5f5 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml
+++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml
@@ -235,6 +235,11 @@
<db:para><db:emphasis role="bold">The following members of class <db:link xlink:href="testqdoc-test.xml">Test</db:link> are deprecated.</db:emphasis> We strongly advise against using them in new code.</db:para>
<db:section xml:id="member-function-documentation">
<db:title>Member Function Documentation</db:title>
+<db:section xml:id="operator-2b-2b">
+<db:title>Test::TestQDoc::Test &amp;operator++()</db:title>
+<db:bridgehead renderas="sect2" xml:id="operator--">Test::TestQDoc::Test &amp;operator--()</db:bridgehead>
+<db:para>This function is deprecated. We strongly advise against using it in new code.</db:para>
+</db:section>
<db:section xml:id="anotherObsoleteMember">
<db:title>Test::void anotherObsoleteMember()</db:title>
<db:methodsynopsis>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/dontdocument/dontdocument.qhp b/tests/auto/qdoc/generatedoutput/expected_output/dontdocument/dontdocument.qhp
index 7657006aa..863a9385c 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/dontdocument/dontdocument.qhp
+++ b/tests/auto/qdoc/generatedoutput/expected_output/dontdocument/dontdocument.qhp
@@ -40,6 +40,8 @@
<keyword name="funcPtr" id="Test::funcPtr" ref="testqdoc-test.html#funcPtr"/>
<keyword name="inlineFunction" id="Test::inlineFunction" ref="testqdoc-test.html#inlineFunction"/>
<keyword name="obsoleteMember" id="Test::obsoleteMember" ref="testqdoc-test-obsolete.html#obsoleteMember"/>
+ <keyword name="operator++" id="Test::operator++" ref="testqdoc-test-obsolete.html#operator-2b-2b"/>
+ <keyword name="operator--" id="Test::operator--" ref="testqdoc-test-obsolete.html#operator--"/>
<keyword name="operator=" id="Test::operator=" ref="testqdoc-test.html#operator-eq"/>
<keyword name="operator==" id="operator==" ref="testqdoc-test.html#operator-eq-eq"/>
<keyword name="overload" id="Test::overload" ref="testqdoc-test.html#overload"/>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml
index 44200db81..a647f1c0c 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml
+++ b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml
@@ -43,6 +43,12 @@
<para>Use <link raw="someFunction()" href="testqdoc-test.html#someFunction" type="function">someFunction()</link> instead.</para>
</description>
</function>
+ <function name="operator++" fullname="TestQDoc::Test::operator++" href="testqdoc-test-obsolete.html#operator-2b-2b" status="deprecated" access="public" location="testcpp.h" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="TestQDoc::Test &amp;" signature="TestQDoc::Test &amp; operator++()">
+ <description/>
+ </function>
+ <function name="operator--" fullname="TestQDoc::Test::operator--" href="testqdoc-test-obsolete.html#operator--" status="deprecated" access="public" location="testcpp.h" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="TestQDoc::Test &amp;" signature="TestQDoc::Test &amp; operator--()">
+ <description/>
+ </function>
<function name="operator=" fullname="TestQDoc::Test::operator=" href="testqdoc-test.html#operator-eq" status="active" access="public" documented="true" meta="move-assign" virtual="non" const="false" static="false" final="false" override="false" type="TestQDoc::Test &amp;" signature="TestQDoc::Test &amp; operator=(TestQDoc::Test &amp;&amp;other)">
<parameter type="TestQDoc::Test &amp;&amp;" name="other" default=""/>
<description>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index b/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index
index 141351e4d..62da1db3a 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index
+++ b/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index
@@ -34,6 +34,8 @@
</function>
<function name="inlineFunction" fullname="TestQDoc::Test::inlineFunction" href="testqdoc-test.html#inlineFunction" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" brief="An inline function, documented using the \fn QDoc command" signature="void inlineFunction()"/>
<function name="obsoleteMember" fullname="TestQDoc::Test::obsoleteMember" href="testqdoc-test-obsolete.html#obsoleteMember" status="deprecated" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void obsoleteMember()"/>
+ <function name="operator++" fullname="TestQDoc::Test::operator++" href="testqdoc-test-obsolete.html#operator-2b-2b" status="deprecated" access="public" location="testcpp.h" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="TestQDoc::Test &amp;" signature="TestQDoc::Test &amp; operator++()"/>
+ <function name="operator--" fullname="TestQDoc::Test::operator--" href="testqdoc-test-obsolete.html#operator--" status="deprecated" access="public" location="testcpp.h" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="TestQDoc::Test &amp;" signature="TestQDoc::Test &amp; operator--()"/>
<function name="operator=" fullname="TestQDoc::Test::operator=" href="testqdoc-test.html#operator-eq" status="active" access="public" documented="true" meta="move-assign" virtual="non" const="false" static="false" final="false" override="false" type="TestQDoc::Test &amp;" signature="TestQDoc::Test &amp; operator=(TestQDoc::Test &amp;&amp;other)">
<parameter type="TestQDoc::Test &amp;&amp;" name="other" default=""/>
</function>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/scopedenum-docbook/testqdoc-test.xml b/tests/auto/qdoc/generatedoutput/expected_output/scopedenum-docbook/testqdoc-test.xml
index 35bbebcae..07d6cb54c 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/scopedenum-docbook/testqdoc-test.xml
+++ b/tests/auto/qdoc/generatedoutput/expected_output/scopedenum-docbook/testqdoc-test.xml
@@ -332,6 +332,11 @@
<db:para><db:emphasis role="bold">The following members of class <db:link xlink:href="testqdoc-test.xml">Test</db:link> are deprecated.</db:emphasis> We strongly advise against using them in new code.</db:para>
<db:section xml:id="member-function-documentation">
<db:title>Member Function Documentation</db:title>
+<db:section xml:id="operator-2b-2b">
+<db:title>Test::TestQDoc::Test &amp;operator++()</db:title>
+<db:bridgehead renderas="sect2" xml:id="operator--">Test::TestQDoc::Test &amp;operator--()</db:bridgehead>
+<db:para>This function is deprecated. We strongly advise against using it in new code.</db:para>
+</db:section>
<db:section xml:id="anotherObsoleteMember">
<db:title>Test::void anotherObsoleteMember()</db:title>
<db:methodsynopsis>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp
index 078ec2cf0..b1b1670cd 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp
+++ b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp
@@ -137,6 +137,8 @@
<keyword name="name" id="Type::name" ref="qml-qdoc-test-type.html#name-prop"/>
<keyword name="obsoleteMember" id="Test::obsoleteMember" ref="testqdoc-test-obsolete.html#obsoleteMember"/>
<keyword name="on" id="Switch::on" ref="qml-uicomponents-switch.html#on-prop"/>
+ <keyword name="operator++" id="Test::operator++" ref="testqdoc-test-obsolete.html#operator-2b-2b"/>
+ <keyword name="operator--" id="Test::operator--" ref="testqdoc-test-obsolete.html#operator--"/>
<keyword name="operator=" id="Test::operator=" ref="testqdoc-test.html#operator-eq"/>
<keyword name="operator==" id="operator==" ref="testqdoc-test.html#operator-eq-eq"/>
<keyword name="overload" id="Test::overload" ref="testqdoc-test.html#overload"/>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index b/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index
index b325bea6c..34d36dd89 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index
+++ b/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index
@@ -33,6 +33,8 @@
</function>
<function name="inlineFunction" fullname="TestQDoc::Test::inlineFunction" href="testqdoc-test.html#inlineFunction" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" brief="An inline function, documented using the \fn QDoc command" signature="void inlineFunction()"/>
<function name="obsoleteMember" fullname="TestQDoc::Test::obsoleteMember" href="testqdoc-test-obsolete.html#obsoleteMember" status="deprecated" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void obsoleteMember()"/>
+ <function name="operator++" fullname="TestQDoc::Test::operator++" href="testqdoc-test-obsolete.html#operator-2b-2b" status="deprecated" access="public" location="testcpp.h" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="TestQDoc::Test &amp;" signature="TestQDoc::Test &amp; operator++()"/>
+ <function name="operator--" fullname="TestQDoc::Test::operator--" href="testqdoc-test-obsolete.html#operator--" status="deprecated" access="public" location="testcpp.h" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="TestQDoc::Test &amp;" signature="TestQDoc::Test &amp; operator--()"/>
<function name="operator=" fullname="TestQDoc::Test::operator=" href="testqdoc-test.html#operator-eq" status="active" access="public" documented="true" meta="move-assign" virtual="non" const="false" static="false" final="false" override="false" type="TestQDoc::Test &amp;" signature="TestQDoc::Test &amp; operator=(TestQDoc::Test &amp;&amp;other)">
<parameter type="TestQDoc::Test &amp;&amp;" name="other" default=""/>
</function>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test-obsolete.html b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test-obsolete.html
new file mode 100644
index 000000000..f2745c488
--- /dev/null
+++ b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test-obsolete.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+<!-- testcpp.cpp -->
+ <title>Obsolete Members for Test | TestCPP</title>
+</head>
+<body>
+<li>Test</li>
+<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div>
+<h1 class="title">Obsolete Members for Test</h1>
+<p><b>The following members of class <a href="testqdoc-test.html">Test</a> are deprecated.</b> They are provided to keep old source code working. We strongly advise against using them in new code.</p>
+<h2>Public Functions</h2>
+<div class="table"><table class="alignedsummary">
+<tr><td class="memItemLeft topAlign rightAlign"> <code>(deprecated) </code>void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test-obsolete.html#anotherObsoleteMember">anotherObsoleteMember</a></b>()</td></tr>
+<tr><td class="memItemLeft topAlign rightAlign"> <code>(deprecated (6.0)) </code>void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test-obsolete.html#deprecatedMember">deprecatedMember</a></b>()</td></tr>
+<tr><td class="memItemLeft topAlign rightAlign"> <code>(deprecated) </code>void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test-obsolete.html#obsoleteMember">obsoleteMember</a></b>()</td></tr>
+<tr><td class="memItemLeft topAlign rightAlign"> <code>(deprecated) </code>TestQDoc::Test &amp;</td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test-obsolete.html#operator-2b-2b">operator++</a></b>()</td></tr>
+<tr><td class="memItemLeft topAlign rightAlign"> <code>(deprecated) </code>TestQDoc::Test &amp;</td><td class="memItemRight bottomAlign"><b><a href="testqdoc-test-obsolete.html#operator--">operator--</a></b>()</td></tr>
+</table></div>
+<h2>Member Function Documentation</h2>
+<!-- $$$ -->
+<div class="fngroup">
+<h3 class="fn fngroupitem" id="operator-2b-2b"><span class="type"><a href="testqdoc-test.html">TestQDoc::Test</a></span> &amp;Test::<span class="name">operator++</span>()</h3><h3 class="fn fngroupitem" id="operator--"><span class="type"><a href="testqdoc-test.html">TestQDoc::Test</a></span> &amp;Test::<span class="name">operator--</span>()</h3></div>
+<p>This function is deprecated. We strongly advise against using it in new code.</p>
+<!-- @@@ -->
+<!-- $$$anotherObsoleteMember[overload1]$$$anotherObsoleteMember -->
+<h3 class="fn" id="anotherObsoleteMember"><span class="type">void</span> Test::<span class="name">anotherObsoleteMember</span>()</h3>
+<p>This function is deprecated. We strongly advise against using it in new code.</p>
+<p>Use <a href="testqdoc-test-obsolete.html#obsoleteMember">obsoleteMember</a>() instead.</p>
+<!-- @@@anotherObsoleteMember -->
+<!-- $$$deprecatedMember[overload1]$$$deprecatedMember -->
+<h3 class="fn" id="deprecatedMember"><span class="type">void</span> Test::<span class="name">deprecatedMember</span>()</h3>
+<p>This function is deprecated since 6.0. We strongly advise against using it in new code.</p>
+<p>Use <a href="testqdoc-test.html#someFunction">someFunction</a>() instead.</p>
+<!-- @@@deprecatedMember -->
+<!-- $$$obsoleteMember[overload1]$$$obsoleteMember -->
+<h3 class="fn" id="obsoleteMember"><span class="type">void</span> Test::<span class="name">obsoleteMember</span>()</h3>
+<p>This function is deprecated. We strongly advise against using it in new code.</p>
+<p>Use <a href="testqdoc-test.html#someFunction">someFunction</a>() instead.</p>
+<!-- @@@obsoleteMember -->
+</body>
+</html>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags b/tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags
index c4b2ad3db..49ceccd6d 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags
+++ b/tests/auto/qdoc/generatedoutput/expected_output/testtagfile.tags
@@ -170,6 +170,20 @@
<arglist>(*)(bool) funcPtr(bool b, const char *s)</arglist>
</member>
<member kind="function" protection="public" virtualness="non" static="no">
+ <type>TestQDoc::Test &amp;</type>
+ <name>operator++</name>
+ <anchorfile>testqdoc-test-obsolete.html</anchorfile>
+ <anchor>operator-2b-2b</anchor>
+ <arglist>()</arglist>
+ </member>
+ <member kind="function" protection="public" virtualness="non" static="no">
+ <type>TestQDoc::Test &amp;</type>
+ <name>operator--</name>
+ <anchorfile>testqdoc-test-obsolete.html</anchorfile>
+ <anchor>operator--</anchor>
+ <arglist>()</arglist>
+ </member>
+ <member kind="function" protection="public" virtualness="non" static="no">
<type>void</type>
<name>inlineFunction</name>
<anchorfile>testqdoc-test.html</anchorfile>
diff --git a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp
index dd02416ac..ef1666c90 100644
--- a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp
+++ b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp
@@ -157,6 +157,12 @@ void Test::someFunctionDefaultArg(int i, bool b = false)
Returns a pointer to a function that takes a boolean. Uses \a b and \a s.
*/
+/*!
+ \fn [op-inc] Test::operator++()
+ \fn [op-dec] Test::operator--()
+ \deprecated
+*/
+
// Documented below with an \fn command. Unnecessary but we support it, and it's used.
int Test::someFunction(int, int v)
{
diff --git a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h
index 3443f93fb..80077da63 100644
--- a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h
+++ b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h
@@ -76,6 +76,12 @@ using Specialized = Struct<int, T>;
void (*funcPtr(bool b, const char *s))(bool) {
return func;
}
+ //! [op-inc]
+ Test &operator++() { return *this; }
+ //! [op-dec]
+ Test &operator--() { return *this; }
+
+ void anotherFunc() {};
inline void inlineFunction() {};
virtual void virtualFun();
diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
index 51dd377a5..54e81714c 100644
--- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
+++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp
@@ -236,6 +236,7 @@ void tst_generatedOutput::htmlFromCpp()
"testcpp-module.html "
"testqdoc-test.html "
"testqdoc-test-members.html "
+ "testqdoc-test-obsolete.html "
"testqdoc-testderived.html "
"testqdoc-testderived-members.html "
"testqdoc-testderived-obsolete.html "