]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix coding error in c-forward-decl-or-cast-1. This fixes bug #36492.
authorAlan Mackenzie <acm@muc.de>
Mon, 8 Jul 2019 12:43:18 +0000 (12:43 +0000)
committerAlan Mackenzie <acm@muc.de>
Mon, 8 Jul 2019 12:43:18 +0000 (12:43 +0000)
* 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.

lisp/progmodes/cc-engine.el

index 2d4046d53267a1701a21ce83ead6c67fcb0c662c..40a3b72f6a23f83d6ab0564d125f53636f4cec4d 100644 (file)
@@ -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