From 6e7f7f6f48e35e09de415bbdeef87d55fefa81ec Mon Sep 17 00:00:00 2001 From: Luca Di Sera Date: Fri, 13 Oct 2023 13:15:10 +0200 Subject: [PATCH] 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 --- src/gui/painting/qrgbafloat.qdoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/painting/qrgbafloat.qdoc b/src/gui/painting/qrgbafloat.qdoc index 718cd31016..14a64029d6 100644 --- a/src/gui/painting/qrgbafloat.qdoc +++ b/src/gui/painting/qrgbafloat.qdoc @@ -33,7 +33,7 @@ */ /*! - \fn template QRgbaFloat::fromRgba64(quint16 r, quint16 g, quint16 b, quint16 a) + \fn template QRgbaFloat QRgbaFloat::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 QRgbaFloat::fromRgba(quint8 red, quint8 green, quint8 blue, quint8 alpha) + \fn template QRgbaFloat QRgbaFloat::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 QRgbaFloat::fromArgb32(uint rgb) + \fn template QRgbaFloat QRgbaFloat::fromArgb32(uint rgb) Constructs a QRgbaFloat value from the 32bit ARGB value \a rgb.