C++ Mode: Handle "if constexpr (...)" with a simple statement correctly
* lisp/progmodes/cc-engine.el (c-beginning-of-statement-1): Add a check and handling for c-block-stmt-hangon-key in the main loop.
This commit is contained in:
parent
3ef6d04dcf
commit
9ef8a3bfca
1 changed files with 9 additions and 0 deletions
|
@ -1184,6 +1184,15 @@ comment at the start of cc-engine.el for more info."
|
|||
;; suitable error.
|
||||
(setq pre-stmt-found t)
|
||||
(throw 'loop nil))
|
||||
;; Handle C++'s `constexpr', etc.
|
||||
(if (save-excursion
|
||||
(and (looking-at c-block-stmt-hangon-key)
|
||||
(progn
|
||||
(c-backward-syntactic-ws lim)
|
||||
(c-safe (c-backward-sexp) t))
|
||||
(looking-at c-block-stmt-2-key)
|
||||
(setq pos (point))))
|
||||
(goto-char pos))
|
||||
(cond
|
||||
;; Have we moved into a macro?
|
||||
((and (not macro-start)
|
||||
|
|
Loading…
Add table
Reference in a new issue