From 05d6b4be45cbef29b9f1eed745825071a67f1bb8 Mon Sep 17 00:00:00 2001 From: David Engster Date: Sun, 25 Jan 2015 22:32:25 +0100 Subject: [PATCH] semantic: Apply enum-type to all members * 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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el index c6a2ef9bd25..5d7d5a6af5f 100644 --- a/lisp/cedet/semantic/bovine/c.el +++ b/lisp/cedet/semantic/bovine/c.el @@ -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; ;; -- 2.39.5