[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 37327e8: Fix coding error in c-forward-decl-or-cast
From: |
Alan Mackenzie |
Subject: |
[Emacs-diffs] master 37327e8: Fix coding error in c-forward-decl-or-cast-1. This fixes bug #36492. |
Date: |
Mon, 8 Jul 2019 08:44:50 -0400 (EDT) |
branch: master
commit 37327e85f3f8530d0f78346004d5087dcb24b66e
Author: Alan Mackenzie <address@hidden>
Commit: Alan Mackenzie <address@hidden>
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.
---
lisp/progmodes/cc-engine.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 2d4046d..40a3b72 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 37327e8: Fix coding error in c-forward-decl-or-cast-1. This fixes bug #36492.,
Alan Mackenzie <=