+2014-11-22 Alan Mackenzie <acm@muc.de>
+
+ Fix error with `mark-defun' and "protected:" in C++ Mode.
+ Fixes: debbugs:19134.
+
+ * progmodes/cc-cmds.el (c-where-wrt-brace-construct): Handle a
+ return code of (label) from c-beginning-of-decl-1.
+
2014-11-22 Ulf Jasper <ulf.jasper@web.de>
* net/newst-backend.el (newsticker--sentinel-work): Tell
(car (c-beginning-of-decl-1
;; NOTE: If we're in a K&R region, this might be the start
;; of a parameter declaration, not the actual function.
+ ;; It might also leave us at a label or "label" like
+ ;; "private:".
(and least-enclosing ; LIMIT for c-b-of-decl-1
(c-safe-position least-enclosing paren-state)))))
;; Has the declaration we've gone back to got braces?
- (setq brace-decl-p
- (save-excursion
+ (or (eq decl-result 'label)
+ (setq brace-decl-p
+ (save-excursion
(and (c-syntactic-re-search-forward "[;{]" nil t t)
(or (eq (char-before) ?\{)
(and c-recognize-knr-p
;; ';' in a K&R argdecl. In
;; that case the declaration
;; should contain a block.
- (c-in-knr-argdecl))))))
+ (c-in-knr-argdecl)))))))
(cond
- ((= (point) kluge-start) ; might be BOB or unbalanced parens.
+ ((or (eq decl-result 'label) ; e.g. "private:" or invalid syntax.
+ (= (point) kluge-start)) ; might be BOB or unbalanced parens.
'outwith-function)
((eq decl-result 'same)
(if brace-decl-p