QDoc: Distinguish Builder-synthesized links from author-written ones


When the IR Builder synthesizes a link prose chunk (the topic page
pointer for an undocumented topic, or a resolved-link helper used by
thread-safety admonitions), the resulting link looks identical in
the IR to a link the author wrote with \sa or \l. Both arrive at
link resolution carrying LinkOrigin::Explicit, so a broken
synthesized link gets the same diagnostic treatment as a broken
author link. That conflation hides a real distinction: synthesized
links don't have an originating source line because no author
wrote them; their natural attribution is the page that triggered
the synthesis.

A new LinkOrigin::Synthesized variant marks Builder-synthesized
links unambiguously. The two synthesizer call sites in IR::Builder
emit the new origin, and link resolution can short-circuit on it
to attribute warnings to the relative node's documentation block —
which is the right answer for synthesized prose. Author-written
links keep the existing LinkOrigin::Explicit / LinkOrigin::Auto
distinction, leaving them unaffected by this change.

Fixes: QTBUG-146719
Change-Id: Idc74d0b1e18cc1318f23e83b692056bff0632149
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
commitf94c32842cf06281bb4fa1c2f827fc39cd262139
parent098e32ab12d3574ab90e94bf02f1a66f80772b63
authorPaul Wicking <paul.wicking@qt.io>
committerPaul Wicking <paul.wicking@qt.io>
commit timeTue, 12 May 2026 11:07:40 +0000