aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2015-12-22 16:10:35 +0000
committerAlan Mackenzie2015-12-22 16:10:35 +0000
commitbe11f9460a9143981bb20d709dbd04932f744099 (patch)
treed87461f148a24871568a758ef2bd4d0d08ec48b7
parent75a005d39b97e2272d1d9a0443d2135fef4c4720 (diff)
downloademacs-be11f9460a9143981bb20d709dbd04932f744099.tar.gz
emacs-be11f9460a9143981bb20d709dbd04932f744099.zip
Fix a coding error in c-forward-<>-arglist-recur. Fixes bug#22156
* lisp/progmodes/cc-engine.el (c-forward-<>-arglist-recur): Remove unused variable `tmp'. After a failed search for a matching ">", restore point before continuing.
-rw-r--r--lisp/progmodes/cc-engine.el22
1 files changed, 11 insertions, 11 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index acc2eddff73..dbc55f5e0ef 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -5964,7 +5964,7 @@ comment at the start of cc-engine.el for more info."
5964 ;; Recursive part of `c-forward-<>-arglist'. 5964 ;; Recursive part of `c-forward-<>-arglist'.
5965 ;; 5965 ;;
5966 ;; This function might do hidden buffer changes. 5966 ;; This function might do hidden buffer changes.
5967 (let ((start (point)) res pos tmp 5967 (let ((start (point)) res pos
5968 ;; Cover this so that any recorded found type ranges are 5968 ;; Cover this so that any recorded found type ranges are
5969 ;; automatically lost if it turns out to not be an angle 5969 ;; automatically lost if it turns out to not be an angle
5970 ;; bracket arglist. It's propagated through the return value 5970 ;; bracket arglist. It's propagated through the return value
@@ -6059,15 +6059,13 @@ comment at the start of cc-engine.el for more info."
6059 ;; Either an operator starting with '<' or a nested arglist. 6059 ;; Either an operator starting with '<' or a nested arglist.
6060 (setq pos (point)) 6060 (setq pos (point))
6061 (let (id-start id-end subres keyword-match) 6061 (let (id-start id-end subres keyword-match)
6062 (cond 6062 (cond
6063 ;; The '<' begins a multi-char operator. 6063 ;; The '<' begins a multi-char operator.
6064 ((looking-at c-<-op-cont-regexp) 6064 ((looking-at c-<-op-cont-regexp)
6065 (setq tmp (match-end 0))
6066 (goto-char (match-end 0))) 6065 (goto-char (match-end 0)))
6067 ;; We're at a nested <.....> 6066 ;; We're at a nested <.....>
6068 ((progn 6067 ((progn
6069 (setq tmp pos) 6068 (backward-char) ; to the '<'
6070 (backward-char) ; to the '<'
6071 (and 6069 (and
6072 (save-excursion 6070 (save-excursion
6073 ;; There's always an identifier before an angle 6071 ;; There's always an identifier before an angle
@@ -6087,7 +6085,9 @@ comment at the start of cc-engine.el for more info."
6087 (and keyword-match 6085 (and keyword-match
6088 (c-keyword-member 6086 (c-keyword-member
6089 (c-keyword-sym (match-string 1)) 6087 (c-keyword-sym (match-string 1))
6090 'c-<>-type-kwds))))))) 6088 'c-<>-type-kwds))))))
6089 (or subres (goto-char pos))
6090 subres)
6091 ;; It was an angle bracket arglist. 6091 ;; It was an angle bracket arglist.
6092 (setq c-record-found-types subres) 6092 (setq c-record-found-types subres)
6093 6093
@@ -6103,11 +6103,11 @@ comment at the start of cc-engine.el for more info."
6103 (c-record-ref-id (cons id-start id-end)) 6103 (c-record-ref-id (cons id-start id-end))
6104 (c-record-type-id (cons id-start id-end))))) 6104 (c-record-type-id (cons id-start id-end)))))
6105 6105
6106 ;; At a "less than" operator. 6106 ;; At a "less than" operator.
6107 (t 6107 (t
6108 (forward-char) 6108 ;; (forward-char) ; NO! We've already gone over the <.
6109 ))) 6109 )))
6110 t) ; carry on looping. 6110 t) ; carry on looping.
6111 6111
6112 ((and (not c-restricted-<>-arglists) 6112 ((and (not c-restricted-<>-arglists)
6113 (or (and (eq (char-before) ?&) 6113 (or (and (eq (char-before) ?&)