From: Alan Mackenzie Date: Fri, 3 Apr 2020 20:37:31 +0000 (+0000) Subject: C++ Mode: recognize brace blocks without the hitherto required = sign X-Git-Tag: emacs-28.0.90~7662 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9b995320c853a45d785896fb25f788f9248658f4;p=emacs.git C++ Mode: recognize brace blocks without the hitherto required = sign * lisp/progmodes/cc-engine.el (c-looking-at-or-maybe-in-bracelist): Add code to recognize a literal brace expression following an array declaration for C++. (c-looking-at-inexpr-block): Replace c-symbol-chars with c-symbol-char-key, fixing a coding error. --- diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index bccef6890f8..aa3f7d399e9 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -11685,7 +11685,16 @@ comment at the start of cc-engine.el for more info." (not (c-in-literal)) )))) nil) - (t t)))))) + (t t))))) + ((and + (c-major-mode-is 'c++-mode) + (eq (char-after) ?\[) + ;; Be careful of "operator []" + (not (save-excursion + (c-backward-token-2 1 nil lim) + (looking-at c-opt-op-identifier-prefix)))) + (setq braceassignp t) + nil)) (when (eq braceassignp 'dontknow) (cond ((and (not (eq (char-after) ?,)) @@ -12057,7 +12066,7 @@ comment at the start of cc-engine.el for more info." (c-backward-token-2 1 nil lim) (and (not (and (c-on-identifier) - (looking-at c-symbol-chars))) + (looking-at c-symbol-char-key))) (not (looking-at c-opt-op-identifier-prefix))))))) (cons 'inlambda bracket-pos)) ((and c-recognize-paren-inexpr-blocks