From: Alan Mackenzie Date: Mon, 8 Jul 2019 12:43:18 +0000 (+0000) Subject: Fix coding error in c-forward-decl-or-cast-1. This fixes bug #36492. X-Git-Tag: emacs-27.0.90~2057 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=37327e85f3f8530d0f78346004d5087dcb24b66e;p=emacs.git 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. --- 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." (not got-prefix) (or (eq context 'top) make-top) (eq (char-after) ?\)) + after-paren-pos (or (memq at-type '(nil maybe)) (not got-identifier) (save-excursion @@ -9508,7 +9509,7 @@ This function might do hidden buffer changes." ;; (con|de)structors in C++ and `c-typeless-decl-kwds' ;; style declarations. That isn't applicable in an ;; arglist context, though. - (when (and (> paren-depth 0) + (when (and (> paren-depth 0) ; ensures `after-paren-pos' is non-nil (not got-prefix-before-parens) (not (eq at-type t)) (or backup-at-type