QDoc: Capture source location on plain link and autolink atoms
When a documentation comment writes \sa target or \l target without
bracketed scope, or when QDoc auto-discovers a documentation
reference from a bare word, the resulting link atom carries no
source location. Only the bracketed forms — \sa[scope] target and
\l[scope] target — go through LinkAtom, which records the file
and line of the originating directive. The plain forms construct a
base-class Atom that has no Location member at all.
This asymmetry doesn't matter for rendering, but it matters for
diagnostics: when a plain \sa target points at something that no
longer exists, the resulting broken-link warning has no way to cite
the line where the author wrote \sa. The warning falls back to
whatever location the surrounding context happens to expose, which
in inherited documentation can be on a completely different page
from where the author actually wrote the directive.
The three plain-form construction sites in DocParser now emit
LinkAtom with the parser's current location, matching the bracketed
form already established at the same file. The change is a
three-line refactor that promotes plain Atom constructions to
LinkAtom constructions. Nothing about how the atom is consumed
changes — LinkAtom is already a subclass of Atom with the same
isLinkAtom() / isAutoLink() dispatch. The new piece is that
consumers downstream can now read the captured location when they
want to attribute diagnostics back to the source.
Fixes: QTBUG-146720
Change-Id: I1520b73607ab39ef2fabfa80cf5d5dd32feea98c
Reviewed-by: Topi Reinio <topi.reinio@qt.io>