Commit 5ccaee4b authored by Alan Mackenzie's avatar Alan Mackenzie

Implement C++ Mode attributes. This fixes bug #36650.

* lisp/progmodes/cc-engine.el (c-looking-at-c++-attribute)
(c-enclosing-c++-attribute, c-slow-enclosing-c++-attribute): New macro and
(c-crosses-statement-barrier-p): Add [ into skip-chars for C++ Mode, and use
it to detect and skip over an attribute whilst scanning forward.
(c-sws-lit-type): Use the new value 'attribute.
(c-invalidate-sws-region-before): Put a save-match-data around this function.
Detect and handle an enclosing attribute at either END or BEG.
(c-invalidate-sws-region-after): Handle C++ attributes.
(c-forward-sws, c-backward-sws): Handle C++ attributes.

* lisp/progmodes/cc-mode.el (c-fl-decl-end): Detect and handle point being
inside a C++ attribute.
parent 5d4dd552
Pipeline #2514 passed with stage
in 52 minutes and 4 seconds
This diff is collapsed.
......@@ -2158,9 +2158,11 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".")
;; count as being in a declarator (on pragmatic grounds).
(goto-char pos)
(let ((lit-start (c-literal-start))
enclosing-attribute pos1)
(unless lit-start
(when (setq enclosing-attribute (c-slow-enclosing-c++-attribute))
(goto-char (car enclosing-attribute))) ; Only happens in C++ Mode.
(when (setq pos1 (c-on-identifier))
(goto-char pos1)
(let ((lim (save-excursion
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment