CC Mode: On removal of "typedef", remove pertinent types from c-found-types
For this purpose, record the type names declared by typedef in a text
property, c-typedef, on the typedef. On any change to that "typedef" or a
type, remove the old identifier(s) from c-found-types.
This should fix bug #59671.
* lisp/progmodes/cc-defs.el (c-search-forward-non-nil-char-property): New
macro.
* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): Move the scope of
identifier-start from the "inner" let form to the outer one. Amend the
return value such that the middle element of the second element is now the
position of the "typedef", not merely non-nil.
* lisp/progmodes/cc-fonts.el (c-font-lock-declarators): Disregard the LIMIT
parameter when fontifying the declarators of a typedef construct. Also in
this case, set the c-typedef text property on the "typedef" to the list of
declared types. Amend this list when these declared types change.
(c-font-lock-single-decl): Massage the `types' argument given to
c-font-lock-declarators.
(c-font-lock-cut-off-declarators): Amend to work when the starting point of
the fontification is inside a brace block.
* lisp/progmodes/cc-mode.el (c-before-change-de-typedef)
(c-after-change-de-typedef): New functions.
(c-update-new-id): Replace the erroneous c-end-of-current-token with a clause
containing c-forward-token-2.
(c-before-change): Call c-before-change-de-typedef.
(c-after-change): Call c-after-change-de-typedef.