]> git.eshelyaron.com Git - emacs.git/commitdiff
CC Mode: Allow "static" etc. to be placed after a declaration's type name
authorAlan Mackenzie <acm@muc.de>
Mon, 18 May 2020 18:20:05 +0000 (18:20 +0000)
committerAlan Mackenzie <acm@muc.de>
Mon, 18 May 2020 18:20:05 +0000 (18:20 +0000)
Fixes bug #41284.

* lisp/progmodes/cc-langs.el (c-type-decl-prefix-key): include additionally
c-modifier-kwds in the set of keywords at the base of this lang-const.

lisp/progmodes/cc-langs.el

index 1e72352f719d4c1b6c26257ed55b5c78162985fa..17ffea59ff0d453522497ac5fb173cd75d7b723d 100644 (file)
@@ -3412,8 +3412,14 @@ regexp should match \"(\" if parentheses are valid in declarators.
 The end of the first submatch is taken as the end of the operator.
 Identifier syntax is in effect when this is matched (see
 `c-identifier-syntax-table')."
-  t (if (c-lang-const c-type-modifier-kwds)
-       (concat (regexp-opt (c-lang-const c-type-modifier-kwds) t) "\\>")
+  t (if (or (c-lang-const c-type-modifier-kwds) (c-lang-const c-modifier-kwds))
+        (concat
+        (regexp-opt (c--delete-duplicates
+                     (append (c-lang-const c-type-modifier-kwds)
+                             (c-lang-const c-modifier-kwds))
+                     :test 'string-equal)
+                    t)
+        "\\>")
       ;; Default to a regexp that never matches.
       regexp-unmatchable)
   ;; Check that there's no "=" afterwards to avoid matching tokens