]> git.eshelyaron.com Git - emacs.git/commit
CC Mode: Cease adding types to found-types too eagerly
authorAlan Mackenzie <acm@muc.de>
Wed, 19 Oct 2022 14:52:14 +0000 (14:52 +0000)
committerAlan Mackenzie <acm@muc.de>
Wed, 19 Oct 2022 14:52:14 +0000 (14:52 +0000)
commitfb8276a17c26b4c2bf8281210ede114ff9e24958
tree40a9236839bca5717a634eb7d5e5677b4521de21
parentb96f441139e09d48880e1f20ad4237400529ac5f
CC Mode: Cease adding types to found-types too eagerly

This fixes bug #58537 and bug #58539.

* lisp/progmodes/cc-engine.el (c-forward-type): Remove trailing whitespace
from an identifier before passing it to c-add-type.
(c-forward-decl-or-cast-1): CASE 3: Do not recognize two consecutive
identifiers as type + variable/function unless certain conditions are met.
CASE 10: Do not recognize the "type" as a found type unless certain condtions
are met.  (Near end): Do not recognize the identifier in a cast as a type
unless certain conditions are met.

* lisp/progmodes/cc-fonts.el (c-get-fontification-context): Recognize being
in declaration parens when there is a syntactially wrong "foo ((bar))"
preceding the match position.

* lisp/progmodes/cc-mode.el (c-update-new-id): Set c-new-id-is-type
unconditionally to nil to prevent a second identifier being wrongly marked as
a type.
lisp/progmodes/cc-engine.el
lisp/progmodes/cc-fonts.el
lisp/progmodes/cc-mode.el