QDoc: Fix template parameter matching
When documenting template classes, QDoc matches documentation
commands to their header declarations by comparing parameter type
strings. A fallback to canonical types only triggers for specific
type categories. LLVM 22 retains more type sugar from template
specializations than previous versions of LLVM, and doesn't report the
type category that activates the fallback. Functions with template-typed
parameters vanish from documentation.
The fallback comparison triggers whenever the original type
strings differ, regardless of type category. This is safe because
canonical comparison is only used as a fallback after the
candidate node, arity, and other matching constraints have already
been narrowed. Bare template type parameters are excluded from
canonicalization to preserve distinct Q_QDOC parameter names that
would otherwise collapse to synthetic type-parameter-N-M
identifiers. Wrapped forms such as const T &, T *, and
Container<T> are safe under canonical fallback because both sides
of the comparison canonicalize symmetrically.
Task-number: QTBUG-144620
Change-Id: I07abcc24f85e18bd30e41806b9859640c2cc56c3
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
| commit | 64d8d66f51bd4cdcbcbb8ede80243c2fa0036f3b |
| parent | 6da4d5f1ac3b266b9e4e0c8ae9f24b77beae4080 |
| author | Paul Wicking <paul.wicking@qt.io> |
| committer | Paul Wicking <paul.wicking@qt.io> |
| commit time | Fri, 20 Mar 2026 15:47:06 +0100 |
- M src/qdoc/qdoc/src/qdoc/clangcodeparser.cpp
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/docbook/aliasuser.xml
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/docbook/connector.xml
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/docbook/dispatcher.xml
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/docbook/mycontainer.xml
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/docbook/templatesugarmodule-module.xml
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/html/aliasuser-members.html
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/html/aliasuser.html
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/html/connector-members.html
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/html/connector.html
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/html/dispatcher-members.html
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/html/dispatcher.html
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/html/mycontainer-members.html
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/html/mycontainer.html
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/html/template-sugar-test.index
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/html/templatesugarmodule-module.html
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/webxml/aliasuser.webxml
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/webxml/connector.webxml
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/webxml/dispatcher.webxml
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/webxml/mycontainer.webxml
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/expected/webxml/templatesugarmodule-module.webxml
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/src/template_sugar.cpp
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_sugar/src/template_sugar.h