emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master ceee275: CC Mode: Allow "static" etc. to be placed after a declar


From: Alan Mackenzie
Subject: master ceee275: CC Mode: Allow "static" etc. to be placed after a declaration's type name
Date: Mon, 18 May 2020 14:21:54 -0400 (EDT)

branch: master
commit ceee275431c7eb07b50cd1ecf7b22d2c0b6ed5f7
Author: Alan Mackenzie <address@hidden>
Commit: Alan Mackenzie <address@hidden>

    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.
---
 lisp/progmodes/cc-langs.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 1e72352..17ffea5 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.
 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]