]> git.eshelyaron.com Git - emacs.git/commitdiff
CC Mode: c-update-brace-stack: After struct foo *, do not expect a brace.
authorAlan Mackenzie <acm@muc.de>
Wed, 29 Dec 2021 19:05:11 +0000 (19:05 +0000)
committerAlan Mackenzie <acm@muc.de>
Wed, 29 Dec 2021 19:05:11 +0000 (19:05 +0000)
This fixes bug #52796.

* lisp/progmodes/cc-engine.el (c-update-brace-stack): Handle a "*" like a
semicolon, cancelling the expectation of a brace.

* lisp/progmodes/cc-langs.el (c-brace-stack-thing-key): Add a "*" into the
sets of significant characters.

lisp/progmodes/cc-engine.el
lisp/progmodes/cc-langs.el

index db1f46621dad4cb74ff8976559390d998c027121..862652e2e5fa1d25dfb77acb713bd87044910924 100644 (file)
@@ -6135,7 +6135,7 @@ comment at the start of cc-engine.el for more info."
          (setq s (cons -1 (cdr s))))
         ((and (equal match ",")
               (eq (car s) -1)))        ; at "," in "class foo : bar, ..."
-        ((member match '(";" "," ")"))
+        ((member match '(";" "*" "," "("))
          (when (and s (cdr s) (<= (car s) 0))
            (setq s (cdr s))))
         ((c-keyword-member kwd-sym 'c-flat-decl-block-kwds)
index 53f6206a821d158837582c5057b2ee0ec6695eb0..85cc8871100705de5f08a7b1be4a6862a32c61ec 100644 (file)
@@ -3180,8 +3180,8 @@ Note that Java specific rules are currently applied to tell this from
       (append
        (c-lang-const c-flat-decl-block-kwds)
        (if (c-lang-const c-recognize-<>-arglists)
-          '("{" "}" ";" "," ")" ":" "<")
-        '("{" "}" ";" "," ")" ":")))))
+          '("{" "}" ";" "*" "," ")" ":" "<")
+        '("{" "}" ";" "*" "," ")" ":")))))
 (c-lang-defvar c-brace-stack-thing-key (c-lang-const c-brace-stack-thing-key))
 
 (c-lang-defconst c-brace-stack-no-semi-key