1 new commit in cc-mode:
Date: 2013-10-19 16:35:28
Summary: Fix fontification bugs with constructors and const.
cc-engine.el (c-forward-decl-or-cast-1): (Just after CASE 2) Remove the
check for the absence of a suffix construct after a function declaration
with only types (no identifiers) in the parentheses. Also, accept a
function declaration with just a type inside the parentheses, if this
type can be positively recognised as such, or if a prefix keyword like
"explicit" nails down the construct as a declaration.
Affected #: 1 file
diff -r d8fb1eab22c059172d71650660632cb04c4c7e69 -r
＠＠ -6956,7 +6956,9 ＠＠
;; can happen since we don't know if
;; `c-restricted-<>-arglists' will be correct inside the
;; arglist paren that gets entered.
+ ;; Start of the identifier for which `got-identifier' was set.
＠＠ -6974,7 +6976,9 ＠＠
;; If the third submatch matches in C++ then
;; we're looking at an identifier that's a
;; prefix only if it specifies a member pointer.
- (when (setq got-identifier (c-forward-name))
+ (when (progn (setq pos (point))
+ (setq got-identifier (c-forward-name)))
+ (setq name-start pos)
(if (looking-at "\\(::\\)")
;; We only check for a trailing "::" and
;; let the "*" that should follow be
＠＠ -7000,7 +7004,9 ＠＠
;; Skip over an identifier.
(and (looking-at c-identifier-start)
- (setq got-identifier (c-forward-name))))
+ (setq pos (point))
+ (setq got-identifier (c-forward-name))
+ (setq name-start pos)))
;; Skip over type decl suffix operators.
(while (if (looking-at c-type-decl-suffix-key)
＠＠ -7093,17 +7099,21 ＠＠
(when (and got-parens
- (not got-suffix-after-parens)
+ ;; (not got-suffix-after-parens)
- ;; Got a declaration of the form "foo bar (gnu);" where we've
- ;; recognized "bar" as the type and "gnu" as the declarator.
- ;; In this case it's however more likely that "bar" is the
- ;; declarator and "gnu" a function argument or initializer (if
- ;; `c-recognize-paren-inits' is set), since the parens around
- ;; "gnu" would be superfluous if it's a declarator. Shift the
- ;; type one step backward.
+ (eq at-decl-or-cast t)
+ (goto-char name-start)
+ (not (memq (c-forward-type) '(nil maybe))))))
+ ;; Got a declaration of the form "foo bar (gnu);" or "bar
+ ;; (gnu);" where we've recognized "bar" as the type and
+ ;; as the declarator. In this case it's however more likely
+ ;; that "bar" is the declarator and "gnu" a function argument
+ ;; or initializer (if `c-recognize-paren-inits' is set),
+ ;; since the parens around "gnu" would be superfluous if it's
+ ;; a declarator. Shift the type one step backward.
;; Found no identifier.
Repository URL: https://bitbucket.org/xemacs/cc-mode/
This is a commit notification from bitbucket.org
. You are receiving
this because you have the service enabled, addressing the recipient of
XEmacs-Patches mailing list