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

C++ Mode: attribute in class declaration fouls up indentation. Fix!

* lisp/progmodes/cc-engine.el (c-looking-at-decl-block): Add code to skip
back over noise clauses and attribute clauses.

* lisp/progmodes/cc-langs.el (c-paren-nontype-key): New language variable.
This commit is contained in:
Alan Mackenzie 2016-05-28 15:17:28 +00:00
parent 549470fdf2
commit 99950f7214
2 changed files with 20 additions and 0 deletions

View file

@ -8899,6 +8899,22 @@ comment at the start of cc-engine.el for more info."
(c-syntactic-skip-backward c-block-prefix-charset limit t)
(eq (char-before) ?>))))))
;; Skip back over noise clauses.
(while (and
c-opt-cpp-prefix
(eq (char-before) ?\))
(let ((after-paren (point)))
(if (and (c-go-list-backward)
(progn (c-backward-syntactic-ws)
(c-simple-skip-symbol-backward))
(or (looking-at c-paren-nontype-key)
(looking-at c-noise-macro-with-parens-name-re)))
(progn
(c-syntactic-skip-backward c-block-prefix-charset limit t)
t)
(goto-char after-paren)
nil))))
;; Note: Can't get bogus hits inside template arglists below since they
;; have gotten paren syntax above.
(when (and

View file

@ -2264,6 +2264,10 @@ contain type identifiers."
;; MSVC extension.
"__declspec"))
(c-lang-defconst c-paren-nontype-key
t (c-make-keywords-re t (c-lang-const c-paren-nontype-kwds)))
(c-lang-defvar c-paren-nontype-key (c-lang-const c-paren-nontype-key))
(c-lang-defconst c-paren-type-kwds
"Keywords that may be followed by a parenthesis expression containing
type identifiers separated by arbitrary tokens."