CC Mode: Prevent ids in temporary "declarators" getting into c-found-types

This should fix bug #60765.  In the scenario type an identifier in front of
foo (bar, baz), as when started a new statement.  This temporarily makes the
function call a declarator, and bar and baz types.  Don't enter bar and baz
into c-found-types.

* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1) (CASE 6): When a
'maybe type triggers this case, set `unsafe-maybe' to non-nil.
This commit is contained in:
Alan Mackenzie 2023-01-16 17:44:44 +00:00
parent 140824dc09
commit c1d32d9a20

View file

@ -10863,7 +10863,13 @@ This function might do hidden buffer changes."
;; types; other identifiers could just as well be
;; constants in C++.
(memq at-type '(known found)))))
(throw 'at-decl-or-cast t)
(progn
;; The user may be part way through typing a statement
;; beginning with an identifier. This makes a 'maybe
;; type in the following "declarator"'s arglist suspect.
(when (eq at-type 'maybe)
(setq unsafe-maybe t))
(throw 'at-decl-or-cast t))
;; CASE 7
;; Can't be a valid declaration or cast, but if we've found a
;; specifier it can't be anything else either, so treat it as