1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Handle C++17's constexpr keyword in if statements

* lisp/progmodes/cc-engine.el (c-after-conditional): Test for matches to
c-block-stmt-hangon-key.

* lisp/progmodes/cc-langs.el (c-block-stmt-hangon-kwds): New lang const.
(c-block-stmt-hangon-key): New lang const/var matching any element of the
above.
This commit is contained in:
Alan Mackenzie 2018-03-28 19:39:30 +00:00
parent 3ccbe1f43f
commit b61b3c804c
2 changed files with 17 additions and 0 deletions

View file

@ -2587,6 +2587,17 @@ Keywords here should also be in `c-block-stmt-1-kwds'."
(c-lang-const c-block-stmt-2-kwds))
:test 'string-equal))
(c-lang-defconst c-block-stmt-hangon-kwds
"Keywords which may directly follow a member of `c-block-stmt-1/2-kwds'."
t nil
c++ '("constexpr"))
(c-lang-defconst c-block-stmt-hangon-key
;; Regexp matching a "hangon" keyword in a `c-block-stmt-1/2-kwds'
;; construct.
t (c-make-keywords-re t (c-lang-const c-block-stmt-hangon-kwds)))
(c-lang-defvar c-block-stmt-hangon-key (c-lang-const c-block-stmt-hangon-key))
(c-lang-defconst c-opt-block-stmt-key
;; Regexp matching the start of any statement that has a
;; substatement (except a bare block). Nil in languages that