Re: [Development] qdoc help needed: it isn't seeing a function that is clearly there

2022-08-09 Thread Marc Mutz
This is https://bugreports.qt.io/browse/QTBUG-101649

I don't see why qdoc shouldn't repeat a failed lookup for

   \relates T
   \fn foo(x)

as if

  \fn T::foo(x)

were given, but I guess we all need to first learn to work around it, and then 
change back once it's fixed.

But qdoc being weird should _not_ be a reason to make it non-hidden. We want 
hidden friends very much, because the alternative is

// foo.cpp
#include 
class Foo {};
void f() {
QDataStream ds;
Foo foo;
ds << foo;

  $ ninja foo | wc -l
  518

HTH,
Marc

On 25.07.22 21:27, Thiago Macieira wrote:

In https://codereview.qt-project.org/c/qt/qtbase/+/422690
Build:
https://testresults.qt.io/coin/integration/qt/qtbase/tasks/1658767511

/home/qt/work/qt/qtbase/src/corelib/kernel/qmetatype.cpp:3032: (qdoc) warning:
clang couldn't find function when parsing \fn int qRegisterMetaType(QMetaType
meta)

The function exists because it's unit-tested and compiled. Why can't qdoc see
it? It's a hidden friend, but that's valid C++ and clang should see it.



___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


Re: [Development] qdoc help needed: it isn't seeing a function that is clearly there

2022-07-25 Thread Topi Reiniö

This will be documented in the qdoc manual as well, see 
https://doc-snapshots.qt.io/qt6-dev/13-qdoc-commands-topics.html#fn-command

In the generated class reference, the hidden friend will appear as a 'related 
non-member'.

\topi

From: Development  on behalf of Volker 
Hilsheimer 
Sent: Monday, July 25, 2022 11:28:58 PM
To: Macieira, Thiago 
Cc: development@qt-project.org 
Subject: Re: [Development] qdoc help needed: it isn't seeing a function that is 
clearly there



> On 25 Jul 2022, at 21:27, Thiago Macieira  wrote:
>
> In https://codereview.qt-project.org/c/qt/qtbase/+/422690
> Build:
> https://testresults.qt.io/coin/integration/qt/qtbase/tasks/1658767511
>
> /home/qt/work/qt/qtbase/src/corelib/kernel/qmetatype.cpp:3032: (qdoc) warning:
> clang couldn't find function when parsing \fn int qRegisterMetaType(QMetaType
> meta)
>
> The function exists because it's unit-tested and compiled. Why can't qdoc see
> it? It's a hidden friend, but that's valid C++ and clang should see it.

Hi Thiago,

In clang’s AST, hidden friends are placed like class member functions, so they 
have to be documented like class members, e.g.

\fn int QMetaType::qRegisterMetaType(QMetaType meta)

This is misleading in this case, and outright invalid C++ in case of operators 
as hidden friends, but it works with the latter, and I expect it will make it 
work with this as well.


Volker

___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development
___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


Re: [Development] qdoc help needed: it isn't seeing a function that is clearly there

2022-07-25 Thread Thiago Macieira
On Monday, 25 July 2022 13:28:58 PDT Volker Hilsheimer wrote:
> \fn int QMetaType::qRegisterMetaType(QMetaType meta)
> 
> This is misleading in this case, and outright invalid C++ in case of
> operators as hidden friends, but it works with the latter, and I expect it
> will make it work with this as well.

That's messed up.

I guess simply pre-declaring the function above the class so it's not a hidden 
friend helps.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering



___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


Re: [Development] qdoc help needed: it isn't seeing a function that is clearly there

2022-07-25 Thread Volker Hilsheimer


> On 25 Jul 2022, at 21:27, Thiago Macieira  wrote:
> 
> In https://codereview.qt-project.org/c/qt/qtbase/+/422690
> Build: 
> https://testresults.qt.io/coin/integration/qt/qtbase/tasks/1658767511
> 
> /home/qt/work/qt/qtbase/src/corelib/kernel/qmetatype.cpp:3032: (qdoc) 
> warning: 
> clang couldn't find function when parsing \fn int qRegisterMetaType(QMetaType 
> meta)
> 
> The function exists because it's unit-tested and compiled. Why can't qdoc see 
> it? It's a hidden friend, but that's valid C++ and clang should see it.

Hi Thiago,

In clang’s AST, hidden friends are placed like class member functions, so they 
have to be documented like class members, e.g.

\fn int QMetaType::qRegisterMetaType(QMetaType meta)

This is misleading in this case, and outright invalid C++ in case of operators 
as hidden friends, but it works with the latter, and I expect it will make it 
work with this as well.


Volker

___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


[Development] qdoc help needed: it isn't seeing a function that is clearly there

2022-07-25 Thread Thiago Macieira
In https://codereview.qt-project.org/c/qt/qtbase/+/422690
Build: 
https://testresults.qt.io/coin/integration/qt/qtbase/tasks/1658767511

/home/qt/work/qt/qtbase/src/corelib/kernel/qmetatype.cpp:3032: (qdoc) warning: 
clang couldn't find function when parsing \fn int qRegisterMetaType(QMetaType 
meta)

The function exists because it's unit-tested and compiled. Why can't qdoc see 
it? It's a hidden friend, but that's valid C++ and clang should see it.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering



___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development