aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2020-05-18 18:20:05 +0000
committerAlan Mackenzie2020-05-18 18:20:05 +0000
commitceee275431c7eb07b50cd1ecf7b22d2c0b6ed5f7 (patch)
tree19af34fb9af6a08568fb36087e30bd48d460805d
parent86594a3ddb04c7b086f1d6796d5102da73020ac7 (diff)
downloademacs-ceee275431c7eb07b50cd1ecf7b22d2c0b6ed5f7.tar.gz
emacs-ceee275431c7eb07b50cd1ecf7b22d2c0b6ed5f7.zip
CC Mode: Allow "static" etc. to be placed after a declaration's type name
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.
-rw-r--r--lisp/progmodes/cc-langs.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 1e72352f719..17ffea59ff0 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -3412,8 +3412,14 @@ regexp should match \"(\" if parentheses are valid in declarators.
3412The end of the first submatch is taken as the end of the operator. 3412The end of the first submatch is taken as the end of the operator.
3413Identifier syntax is in effect when this is matched (see 3413Identifier syntax is in effect when this is matched (see
3414`c-identifier-syntax-table')." 3414`c-identifier-syntax-table')."
3415 t (if (c-lang-const c-type-modifier-kwds) 3415 t (if (or (c-lang-const c-type-modifier-kwds) (c-lang-const c-modifier-kwds))
3416 (concat (regexp-opt (c-lang-const c-type-modifier-kwds) t) "\\>") 3416 (concat
3417 (regexp-opt (c--delete-duplicates
3418 (append (c-lang-const c-type-modifier-kwds)
3419 (c-lang-const c-modifier-kwds))
3420 :test 'string-equal)
3421 t)
3422 "\\>")
3417 ;; Default to a regexp that never matches. 3423 ;; Default to a regexp that never matches.
3418 regexp-unmatchable) 3424 regexp-unmatchable)
3419 ;; Check that there's no "=" afterwards to avoid matching tokens 3425 ;; Check that there's no "=" afterwards to avoid matching tokens