summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-engine.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2017-04-22 14:45:24 +0000
committerAlan Mackenzie <acm@muc.de>2017-04-22 14:45:24 +0000
commitd354fc38286cba05b3ba2fefb9d9cd6d30deac3d (patch)
treec69648ef131e92d502fb1a2aded5ba7030a999a0 /lisp/progmodes/cc-engine.el
parenteb52828a439f674733ba70844b795c6673733572 (diff)
downloademacs-d354fc38286cba05b3ba2fefb9d9cd6d30deac3d.tar.gz
emacs-d354fc38286cba05b3ba2fefb9d9cd6d30deac3d.tar.bz2
emacs-d354fc38286cba05b3ba2fefb9d9cd6d30deac3d.zip
Fix fontification of C++ declaration with type FOO::FOO.
* lisp/progmodes/cc-engine.el (c-find-decl-spots): Initialize cfd-top-level properly. (c-forward-decl-or-cast-1): On finding FOO::FOO, check it is followed by "(" before deciding it is a constructor. * lisp/progmodes/cc-fonts.el (c-font-lock-complex-decl-prepare): Negate the result of the c-bs-at-toplevel-p call passed to c-font-lock-declarators (simple bug fix).
Diffstat (limited to 'lisp/progmodes/cc-engine.el')
-rw-r--r--lisp/progmodes/cc-engine.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index e7a8962ac2b..4af7c359747 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -5681,7 +5681,7 @@ comment at the start of cc-engine.el for more info."
;; Whether the last position returned from `c-find-decl-prefix-search'
;; is at the top-level (including directly in a class or namespace,
;; etc.).
- cfd-top-level)
+ (cfd-top-level (c-bs-at-toplevel-p (point))))
;; Initialize by finding a syntactically relevant start position
;; before the point, and do the first `c-decl-prefix-or-start-re'
@@ -8379,7 +8379,11 @@ comment at the start of cc-engine.el for more info."
(c-simple-skip-symbol-backward))
(>= (point) type-start)
(equal (buffer-substring-no-properties (point) end-1)
- name))
+ name)
+ (goto-char end-2)
+ (progn
+ (c-forward-syntactic-ws)
+ (eq (char-after) ?\()))
;; It is a (con|de)structor name. In that case the
;; declaration is typeless so zap out any preceding
;; identifier(s) that we might have taken as types.