]> git.eshelyaron.com Git - emacs.git/commitdiff
CC Mode: Prevent lone ids being parsed as types unless in decl arglists
authorAlan Mackenzie <acm@muc.de>
Tue, 29 Nov 2022 20:19:34 +0000 (20:19 +0000)
committerAlan Mackenzie <acm@muc.de>
Tue, 29 Nov 2022 20:22:58 +0000 (20:22 +0000)
This fixes bug #59051.

* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): In the test for the
last invocation of c-fdoc-shift-type-backward before CASE 1, additionally
test CONTEXT not being an arglist or BACKUP-AT-TYPE being non-nil.

lisp/progmodes/cc-engine.el

index 11ddb39ed91fa0eb6b16cfd481954827ee1b3270..edb873f5a6238781e6583922d5725f41bc756735 100644 (file)
@@ -10678,6 +10678,8 @@ This function might do hidden buffer changes."
        (c-forward-syntactic-ws))
 
       (when (and (not got-identifier)
+                (or backup-at-type
+                    (not (memq context '(arglist decl))))
                 (or (and new-style-auto
                          (looking-at c-auto-ops-re))
                     (and (or maybe-typeless backup-maybe-typeless)