aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2019-07-08 12:43:18 +0000
committerAlan Mackenzie2019-07-08 12:43:18 +0000
commit37327e85f3f8530d0f78346004d5087dcb24b66e (patch)
tree3dfa44026e8fc409146df7741667a0002e0adfb3
parentd750b37cece666716d234c6e529a3f5d9bc56bd5 (diff)
downloademacs-37327e85f3f8530d0f78346004d5087dcb24b66e.tar.gz
emacs-37327e85f3f8530d0f78346004d5087dcb24b66e.zip
Fix coding error in c-forward-decl-or-cast-1. This fixes bug #36492.
* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): While testing for, e.g., foo(), check we've found the ( before trying to go to its position.
-rw-r--r--lisp/progmodes/cc-engine.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 2d4046d5326..40a3b72f6a2 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -9472,6 +9472,7 @@ This function might do hidden buffer changes."
9472 (not got-prefix) 9472 (not got-prefix)
9473 (or (eq context 'top) make-top) 9473 (or (eq context 'top) make-top)
9474 (eq (char-after) ?\)) 9474 (eq (char-after) ?\))
9475 after-paren-pos
9475 (or (memq at-type '(nil maybe)) 9476 (or (memq at-type '(nil maybe))
9476 (not got-identifier) 9477 (not got-identifier)
9477 (save-excursion 9478 (save-excursion
@@ -9508,7 +9509,7 @@ This function might do hidden buffer changes."
9508 ;; (con|de)structors in C++ and `c-typeless-decl-kwds' 9509 ;; (con|de)structors in C++ and `c-typeless-decl-kwds'
9509 ;; style declarations. That isn't applicable in an 9510 ;; style declarations. That isn't applicable in an
9510 ;; arglist context, though. 9511 ;; arglist context, though.
9511 (when (and (> paren-depth 0) 9512 (when (and (> paren-depth 0) ; ensures `after-paren-pos' is non-nil
9512 (not got-prefix-before-parens) 9513 (not got-prefix-before-parens)
9513 (not (eq at-type t)) 9514 (not (eq at-type t))
9514 (or backup-at-type 9515 (or backup-at-type