Doc: Add missing return type to QRgbaFloat::fromRgba*

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 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 `QRgbaFloat::fromRgba*` make 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.

Task-number: QTBUG-111580
Change-Id: Id9d8a713caf7d6cbb4d2de1040ce5ea5092f7b14
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This commit is contained in:
Luca Di Sera 2023-10-13 13:15:10 +02:00
parent 2dce499561
commit 6e7f7f6f48

View File

@ -33,7 +33,7 @@
*/
/*!
\fn template<typename F> QRgbaFloat<F>::fromRgba64(quint16 r, quint16 g, quint16 b, quint16 a)
\fn template<typename F> QRgbaFloat QRgbaFloat<F>::fromRgba64(quint16 r, quint16 g, quint16 b, quint16 a)
Constructs a QRgbaFloat value from the four 16-bit integer color channels \a red, \a green, \a blue and \a alpha.
@ -41,7 +41,7 @@
*/
/*!
\fn template<typename F> QRgbaFloat<F>::fromRgba(quint8 red, quint8 green, quint8 blue, quint8 alpha)
\fn template<typename F> QRgbaFloat QRgbaFloat<F>::fromRgba(quint8 red, quint8 green, quint8 blue, quint8 alpha)
Constructs a QRgbaFloat value from the four 8-bit color channels \a red, \a green, \a blue and \a alpha.
@ -49,7 +49,7 @@
*/
/*!
\fn template<typename F> QRgbaFloat<F>::fromArgb32(uint rgb)
\fn template<typename F> QRgbaFloat QRgbaFloat<F>::fromArgb32(uint rgb)
Constructs a QRgbaFloat value from the 32bit ARGB value \a rgb.