aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2022-08-24 19:27:32 +0000
committerAlan Mackenzie2022-08-24 19:27:32 +0000
commit78923c5f4e26d3cb9fbaf0dbf2d04c523482e52c (patch)
tree1215702df97232bd09c7195b0377e0f63ef450f5
parent95b1eacd4750da7329380aabcb383a8f9d96a59b (diff)
downloademacs-78923c5f4e26d3cb9fbaf0dbf2d04c523482e52c.tar.gz
emacs-78923c5f4e26d3cb9fbaf0dbf2d04c523482e52c.zip
C++ Mode - Fontify "class Foo {\n ~Foo() noexcept;" correctly
This fixes bug #49787. * lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): (In `if' form just before CASE 8) Remove the (not ...) around the (looking-at c-after-suffixed-type-maybe-decl-key). * lisp/progmodes/cc-fonts.el (c-font-lock-complex-decl-prepare): Add `c-not-decl' to the values of c-type which are erased at the start of a fontification.
-rw-r--r--lisp/progmodes/cc-engine.el4
-rw-r--r--lisp/progmodes/cc-fonts.el3
2 files changed, 4 insertions, 3 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index f46c909fea5..1139423a455 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -10571,8 +10571,8 @@ This function might do hidden buffer changes."
10571 backup-maybe-typeless 10571 backup-maybe-typeless
10572 (when c-recognize-typeless-decls 10572 (when c-recognize-typeless-decls
10573 (or (not got-suffix) 10573 (or (not got-suffix)
10574 (not (looking-at 10574 (looking-at
10575 c-after-suffixed-type-maybe-decl-key)))))) 10575 c-after-suffixed-type-maybe-decl-key)))))
10576 ;; Got an empty paren pair and a preceding type that probably 10576 ;; Got an empty paren pair and a preceding type that probably
10577 ;; really is the identifier. Shift the type backwards to make 10577 ;; really is the identifier. Shift the type backwards to make
10578 ;; the last one the identifier. This is analogous to the 10578 ;; the last one the identifier. This is analogous to the
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index 2495d21a10f..12bb3d37513 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -940,7 +940,8 @@ casts and declarations are fontified. Used on level 2 and higher."
940 '(c-decl-arg-start 940 '(c-decl-arg-start
941 c-decl-end 941 c-decl-end
942 c-decl-id-start 942 c-decl-id-start
943 c-decl-type-start))) 943 c-decl-type-start
944 c-not-decl)))
944 (1- (point)) 945 (1- (point))
945 pos) 946 pos)
946 limit 'c-type))) 947 limit 'c-type)))