]> git.eshelyaron.com Git - emacs.git/commitdiff
semantic: Apply enum-type to all members
authorDavid Engster <deng@randomsample.de>
Sun, 25 Jan 2015 21:32:25 +0000 (22:32 +0100)
committerDavid Engster <deng@randomsample.de>
Thu, 19 Jan 2017 21:36:53 +0000 (22:36 +0100)
* lisp/cedet/semantic/bovine/c.el (semantic-expand-c-tag): For typed
  enums, apply the :enum-type attribute as :type to all members.

lisp/cedet/semantic/bovine/c.el

index c6a2ef9bd256ab6414c03138798178a5f5b37f1a..5d7d5a6af5ffe9429a952f92e633240b5b68a28c 100644 (file)
@@ -1022,6 +1022,15 @@ now.
       (setq return-list (car tag))
       (setq tag (cdr tag)))
 
+    ;; Check if we have a typed enum, and if so, apply its type to all
+    ;; members.
+    (when (and (semantic-tag-of-type-p tag "enum")
+              (semantic-tag-get-attribute tag :enum-type))
+      (let ((enumtype (semantic-tag-get-attribute tag :enum-type))
+           (members (semantic-tag-get-attribute tag :members)))
+       (dolist (cur members)
+         (semantic-tag-put-attribute cur :type enumtype))))
+
     ;; Name of the tag is a list, so expand it.  Tag lists occur
     ;; for variables like this: int var1, var2, var3;
     ;;