summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlist.qdoc
diff options
context:
space:
mode:
authorLuca Di Sera <luca.disera@qt.io>2023-10-06 15:18:11 +0200
committerLuca Di Sera <luca.disera@qt.io>2023-10-13 14:12:27 +0200
commit11424b3f518eea68110b7167643009bb35982418 (patch)
treea0e137b83385d63a1c1fab12603cbead6a022478 /src/corelib/tools/qlist.qdoc
parent479c2add326d368473829dcdb2a34b577f6ddfe2 (diff)
Doc: Add missing return type to QList/QVarLengthArray::assign
When QDoc reads an `\fn` command it saves it to a file to parse it with Clang, with the objective of using the produced AST to perform certain sanity checks on the documented element. Generally, `\fn` commands that do not represent correct C++ code with are accepted as long as Clang is still able to build an AST Node that QDoc can work with, not resulting in any issue in the output documentation. For example, an `\fn` that doesn't state a return type might be able to be parsed correctly enough by Clang to produce a sensible Node for the function that QDoc is interested into. The documentation for the various overloads for QList::assign and QVarLenghtArray::assign makes use of this possibility by not stating a return type. Up to Clang 15 this was not an issue, and a correct-enough AST was produced when the `\fn` commands for those methods were parsed. On Clang 16, Clang chokes on the missing return type, being unable to recognize the function definition and produce an AST that QDoc can work with. This has the effect of losing those documented element in the output documentation. To avoid the issue, a return type is now added to the relevant `\fn` commands. Change-Id: Ic1434aaf71c39840c64ce04fbd503c4542dc4f42 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/corelib/tools/qlist.qdoc')
-rw-r--r--src/corelib/tools/qlist.qdoc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/tools/qlist.qdoc b/src/corelib/tools/qlist.qdoc
index f0e24df26f..a44fb467b5 100644
--- a/src/corelib/tools/qlist.qdoc
+++ b/src/corelib/tools/qlist.qdoc
@@ -1539,7 +1539,7 @@
\sa erase
*/
-/*! \fn template <typename T> QList<T>::assign(qsizetype n, parameter_type t)
+/*! \fn template <typename T> QList<T>& QList<T>::assign(qsizetype n, parameter_type t)
\since 6.6
Replaces the contents of this list with \a n copies of \a t.
@@ -1550,7 +1550,7 @@
list or this list is shared.
*/
-/*! \fn template <typename T> template <typename InputIterator, if_input_iterator<InputIterator>> QList<T>::assign(InputIterator first, InputIterator last)
+/*! \fn template <typename T> template <typename InputIterator, if_input_iterator<InputIterator>> QList<T>& QList<T>::assign(InputIterator first, InputIterator last)
\since 6.6
Replaces the contents of this list with a copy of the elements in the
@@ -1570,7 +1570,7 @@
*this.
*/
-/*! \fn template <typename T> QList<T>::assign(std::initializer_list<T> l)
+/*! \fn template <typename T> QList<T>& QList<T>::assign(std::initializer_list<T> l)
\since 6.6
Replaces the contents of this list with a copy of the elements of