From unknown Mon Aug 11 21:13:50 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#35194 <35194@debbugs.gnu.org> To: bug#35194 <35194@debbugs.gnu.org> Subject: Status: CC Mode 5.33.1 (C++//l); Indentation of C++ methods with ref-qualifiers is broken. Reply-To: bug#35194 <35194@debbugs.gnu.org> Date: Tue, 12 Aug 2025 04:13:50 +0000 retitle 35194 CC Mode 5.33.1 (C++//l); Indentation of C++ methods with ref-= qualifiers is broken. reassign 35194 cc-mode submitter 35194 Tau severity 35194 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 08 10:18:21 2019 Received: (at submit) by debbugs.gnu.org; 8 Apr 2019 14:18:22 +0000 Received: from localhost ([127.0.0.1]:50055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDV6L-0002Pj-7D for submit@debbugs.gnu.org; Mon, 08 Apr 2019 10:18:21 -0400 Received: from ea7aba.be ([172.104.149.205]:33564 helo=mail.ea7aba.be) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDTA5-0007I5-U3 for submit@debbugs.gnu.org; Mon, 08 Apr 2019 08:14:06 -0400 Received: from ea7ababe (unknown [91.200.114.65]) by mail.ea7aba.be (Postfix) with ESMTPSA id 76C6460940 for ; Mon, 8 Apr 2019 12:13:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ea7aba.be; s=mail; t=1554725643; bh=nXIxVq+jsdLYaJb7NoZ+blw2A/wqRI9BBle/Ucxqogw=; h=Date:From:To:Subject; b=uPYpBfk/gpQdvMzlhtxOEdhwySoiRgwxCuI6sY244nmxOdIQLdNVSapjyX4CODyPO 8pHTES/W1Rka9psoCAjCOvzew4XrCFRUHf5gpFWzG2gxvGYBeGrCLDzi7TfEznFjjo TYQUKepuoxEYWEAep+4P08WmF4H5A2FLLiNDMZec= Date: Mon, 8 Apr 2019 15:13:25 +0300 From: Tau To: submit@debbugs.gnu.org Subject: CC Mode 5.33.1 (C++//l); Indentation of C++ methods with ref-qualifiers is broken. Message-ID: <20190408151325.6ff7ded6@ea7ababe> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 08 Apr 2019 10:18:17 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Methods with ref-qualifiers (& and &&) seem to get indented with "brace-list-intro" which, as I understand it, is used for initializer lists and not code blocks. It is set to "c-lineup-arglist-intro-after-paren" in GNU style which is the default. Functions that use the auto syntax for return types and return a reference are affected as well. // Example of incorrect indentation in a program: #include struct T { void a_method() && { std::cout << "rvalue ref\n"; } void a_method() const& { std::cout << "lvalue const ref\n"; } void this_gets_properly_indented() const { std::cout << "without a ref-qualifier\n"; } auto this_too() && -> void { std::cout << "rvalue ref; '->' notation\n"; } auto this_breaks_again() -> T& { return *this; } }; int main() { T x; T().a_method(); x.a_method(); } Emacs : GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-07-05 Package: CC Mode 5.33.1 (C++//l) Buffer Style: gnu c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-string-delim gen-comment-delim syntax-properties 1-bit) current state: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (setq c-basic-offset 2 c-comment-only-line-offset '(0 . 0) c-indent-comment-alist '((anchored-comment column . 0) (end-block space . 1) (cpp-end-block space . 2)) c-indent-comments-syntactically-p nil c-block-comment-prefix "" c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (awk-mode . "#+") (other . "//+\\|\\**")) c-doc-comment-style '((java-mode . javadoc) (pike-mode . autodoc) (c-mode . gtkdoc)) c-cleanup-list '(scope-operator) c-hanging-braces-alist '((substatement-open before after) (arglist-cont-nonempty)) c-hanging-colons-alist nil c-hanging-semi&comma-criteria '(c-semi&comma-inside-parenlist) c-backslash-column 48 c-backslash-max-column 72 c-special-indent-hook '(c-gnu-impose-minimum) c-label-minimum-indentation 1 c-offsets-alist '((inexpr-class . +) (inexpr-statement . +) (lambda-intro-cont . +) (inlambda . c-lineup-inexpr-block) (template-args-cont c-lineup-template-args +) (incomposition . +) (inmodule . +) (innamespace . +) (inextern-lang . +) (composition-close . 0) (module-close . 0) (namespace-close . 0) (extern-lang-close . 0) (composition-open . 0) (module-open . 0) (namespace-open . 0) (extern-lang-open . 0) (objc-method-call-cont c-lineup-ObjC-method-call-colons c-lineup-ObjC-method-call + ) (objc-method-args-cont . c-lineup-ObjC-method-args) (objc-method-intro . [0]) (friend . 0) (cpp-define-intro c-lineup-cpp-define +) (cpp-macro-cont . +) (cpp-macro . [0]) (inclass . +) (stream-op . c-lineup-streamop) (arglist-cont-nonempty c-lineup-gcc-asm-reg c-lineup-arglist) (arglist-cont c-lineup-gcc-asm-reg 0) (comment-intro c-lineup-knr-region-comment c-lineup-comment) (catch-clause . 0) (else-clause . 0) (do-while-closure . 0) (access-label . -) (case-label . 0) (substatement . +) (statement-case-intro . +) (statement . 0) (brace-entry-open . 0) (brace-list-entry . c-lineup-under-anchor) (brace-list-close . 0) (block-close . 0) (block-open . 0) (inher-cont . c-lineup-multi-inher) (inher-intro . +) (member-init-cont . c-lineup-multi-inher) (member-init-intro . +) (annotation-var-cont . +) (annotation-top-cont . 0) (topmost-intro . 0) (knr-argdecl . 0) (func-decl-cont . +) (inline-close . 0) (class-close . 0) (class-open . 0) (defun-block-intro . +) (defun-close . 0) (defun-open . 0) (c . c-lineup-C-comments) (string . c-lineup-dont-change) (topmost-intro-cont first c-lineup-topmost-intro-cont c-lineup-gnu-DEFUN-intro-cont ) (brace-list-intro . c-lineup-arglist-intro-after-paren) (brace-list-open . +) (inline-open . 0) (arglist-close . c-lineup-arglist) (arglist-intro . c-lineup-arglist-intro-after-paren) (statement-cont . +) (statement-case-open . +) (label . 0) (substatement-label . 0) (substatement-open . +) (knr-argdecl-intro . 5) (statement-block-intro . +) ) c-buffer-is-cc-mode 'c++-mode c-tab-always-indent t c-syntactic-indentation t c-syntactic-indentation-in-macros t c-ignore-auto-fill '(string cpp code) c-auto-align-backslashes t c-backspace-function 'backward-delete-char-untabify c-delete-function 'delete-char c-electric-pound-behavior nil c-default-style '((java-mode . "java") (awk-mode . "awk") (other . "gnu")) c-enable-xemacs-performance-kludge-p nil c-old-style-variable-behavior nil defun-prompt-regexp nil tab-width 8 comment-column 32 parse-sexp-ignore-comments t parse-sexp-lookup-properties t auto-fill-function nil comment-multi-line t comment-start-skip "\\(//+\\|/\\*+\\)\\s *" fill-prefix nil fill-column 70 paragraph-start "[ ]*\\(//+\\|\\**\\)[ ]*$\\|^\f" adaptive-fill-mode t adaptive-fill-regexp "[ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\([-=E2=80=93!|#%;>*=C2=B7=E2=80=A2=E2= =80=A3=E2=81=83=E2=97=A6]+[ ]*\\)*\\)" ) From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 08 12:10:36 2019 Received: (at control) by debbugs.gnu.org; 8 Apr 2019 16:10:36 +0000 Received: from localhost ([127.0.0.1]:50140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDWqx-0005Ge-QX for submit@debbugs.gnu.org; Mon, 08 Apr 2019 12:10:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41575) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDWqw-0005GR-LA for control@debbugs.gnu.org; Mon, 08 Apr 2019 12:10:34 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49290) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDWqr-0003x9-FA for control@debbugs.gnu.org; Mon, 08 Apr 2019 12:10:29 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1hDWqq-0008GK-RQ for control@debbugs.gnu.org; Mon, 08 Apr 2019 12:10:29 -0400 Subject: control message for bug 35194 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Mon, 08 Apr 2019 12:10:28 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) reassign 35194 cc-mode From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 08 12:18:20 2019 Received: (at 35194) by debbugs.gnu.org; 8 Apr 2019 16:18:21 +0000 Received: from localhost ([127.0.0.1]:50144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDWyS-0007VL-IT for submit@debbugs.gnu.org; Mon, 08 Apr 2019 12:18:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43351) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDWyR-0007V8-9x for 35194@debbugs.gnu.org; Mon, 08 Apr 2019 12:18:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDWyL-0008KN-Pm; Mon, 08 Apr 2019 12:18:13 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1hDWyK-0000fs-7b; Mon, 08 Apr 2019 12:18:12 -0400 From: Glenn Morris To: 35194@debbugs.gnu.org Subject: Re: bug#35194: CC Mode 5.33.1 (C++//l); Indentation of C++ methods with ref-qualifiers is broken. References: <20190408151325.6ff7ded6@ea7ababe> Mail-Followup-To: tau@ea7aba.be, 35194@debbugs.gnu.org Date: Mon, 08 Apr 2019 12:18:11 -0400 In-Reply-To: <20190408151325.6ff7ded6@ea7ababe> (tau@ea7aba.be's message of "Mon, 8 Apr 2019 15:13:25 +0300") Message-ID: <2ry34kfp30.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 35194 Cc: Tau X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: tau@ea7aba.be, 35194@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Report reassigned to cc-mode. (It seems that cc-mode users not infrequently report bugs from mail clients that don't support X- headers. So I suggest also putting "Package: cc-mode" at the start of the message body in c-submit-bug-report.) Tau wrote: > Methods with ref-qualifiers (& and &&) seem to get indented with > "brace-list-intro" which, as I understand it, is used for > initializer lists and not code blocks. It is set to > "c-lineup-arglist-intro-after-paren" in GNU style which is the > default. > > Functions that use the auto syntax for return types and return > a reference are affected as well. > > // Example of incorrect indentation in a program: > > #include > > struct T { > void a_method() && { > std::cout << "rvalue ref\n"; > } > > void a_method() const& { > std::cout << "lvalue const ref\n"; > } > > void this_gets_properly_indented() const { > std::cout << "without a ref-qualifier\n"; > } > > auto this_too() && -> void { > std::cout << "rvalue ref; '->' notation\n"; > } > > auto this_breaks_again() -> T& { > return *this; > } > }; > > int main() { > T x; > > T().a_method(); > x.a_method(); > } > > Emacs : GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version > 3.22.30) of 2018-07-05 > Package: CC Mode 5.33.1 (C++//l) > Buffer Style: gnu > c-emacs-features: (pps-extended-state col-0-paren posix-char-classes > gen-string-delim gen-comment-delim syntax-properties 1-bit) > > current state: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > (setq > c-basic-offset 2 > c-comment-only-line-offset '(0 . 0) > c-indent-comment-alist '((anchored-comment column . 0) (end-block > space . 1) (cpp-end-block space . 2)) > c-indent-comments-syntactically-p nil > c-block-comment-prefix "" > c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (awk-mode . > "#+") (other . "//+\\|\\**")) > c-doc-comment-style '((java-mode . javadoc) (pike-mode . autodoc) > (c-mode . gtkdoc)) c-cleanup-list '(scope-operator) > c-hanging-braces-alist '((substatement-open before after) > (arglist-cont-nonempty)) c-hanging-colons-alist nil > c-hanging-semi&comma-criteria '(c-semi&comma-inside-parenlist) > c-backslash-column 48 > c-backslash-max-column 72 > c-special-indent-hook '(c-gnu-impose-minimum) > c-label-minimum-indentation 1 > c-offsets-alist '((inexpr-class . +) > (inexpr-statement . +) > (lambda-intro-cont . +) > (inlambda . c-lineup-inexpr-block) > (template-args-cont c-lineup-template-args +) > (incomposition . +) > (inmodule . +) > (innamespace . +) > (inextern-lang . +) > (composition-close . 0) > (module-close . 0) > (namespace-close . 0) > (extern-lang-close . 0) > (composition-open . 0) > (module-open . 0) > (namespace-open . 0) > (extern-lang-open . 0) > (objc-method-call-cont > c-lineup-ObjC-method-call-colons > c-lineup-ObjC-method-call > + > ) > (objc-method-args-cont . c-lineup-ObjC-method-args) > (objc-method-intro . [0]) > (friend . 0) > (cpp-define-intro c-lineup-cpp-define +) > (cpp-macro-cont . +) > (cpp-macro . [0]) > (inclass . +) > (stream-op . c-lineup-streamop) > (arglist-cont-nonempty c-lineup-gcc-asm-reg > c-lineup-arglist) (arglist-cont c-lineup-gcc-asm-reg 0) > (comment-intro c-lineup-knr-region-comment > c-lineup-comment) (catch-clause . 0) > (else-clause . 0) > (do-while-closure . 0) > (access-label . -) > (case-label . 0) > (substatement . +) > (statement-case-intro . +) > (statement . 0) > (brace-entry-open . 0) > (brace-list-entry . c-lineup-under-anchor) > (brace-list-close . 0) > (block-close . 0) > (block-open . 0) > (inher-cont . c-lineup-multi-inher) > (inher-intro . +) > (member-init-cont . c-lineup-multi-inher) > (member-init-intro . +) > (annotation-var-cont . +) > (annotation-top-cont . 0) > (topmost-intro . 0) > (knr-argdecl . 0) > (func-decl-cont . +) > (inline-close . 0) > (class-close . 0) > (class-open . 0) > (defun-block-intro . +) > (defun-close . 0) > (defun-open . 0) > (c . c-lineup-C-comments) > (string . c-lineup-dont-change) > (topmost-intro-cont > first > c-lineup-topmost-intro-cont > c-lineup-gnu-DEFUN-intro-cont > ) > (brace-list-intro . > c-lineup-arglist-intro-after-paren) (brace-list-open . +) > (inline-open . 0) > (arglist-close . c-lineup-arglist) > (arglist-intro . c-lineup-arglist-intro-after-paren) > (statement-cont . +) > (statement-case-open . +) > (label . 0) > (substatement-label . 0) > (substatement-open . +) > (knr-argdecl-intro . 5) > (statement-block-intro . +) > ) > c-buffer-is-cc-mode 'c++-mode > c-tab-always-indent t > c-syntactic-indentation t > c-syntactic-indentation-in-macros t > c-ignore-auto-fill '(string cpp code) > c-auto-align-backslashes t > c-backspace-function 'backward-delete-char-untabify > c-delete-function 'delete-char > c-electric-pound-behavior nil > c-default-style '((java-mode . "java") (awk-mode . "awk") (other . > "gnu")) c-enable-xemacs-performance-kludge-p nil > c-old-style-variable-behavior nil > defun-prompt-regexp nil > tab-width 8 > comment-column 32 > parse-sexp-ignore-comments t > parse-sexp-lookup-properties t > auto-fill-function nil > comment-multi-line t > comment-start-skip "\\(//+\\|/\\*+\\)\\s *" > fill-prefix nil > fill-column 70 > paragraph-start "[ ]*\\(//+\\|\\**\\)[ ]*$\\|^\f" > adaptive-fill-mode t > adaptive-fill-regexp > "[ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\([-=E2=80=93!|#%;>*=C2=B7=E2=80=A2= =E2=80=A3=E2=81=83=E2=97=A6]+[ ]*\\)*\\)" ) From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 12 09:05:05 2019 Received: (at 35194) by debbugs.gnu.org; 12 Apr 2019 13:05:05 +0000 Received: from localhost ([127.0.0.1]:55602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hEvrc-00030v-Q3 for submit@debbugs.gnu.org; Fri, 12 Apr 2019 09:05:05 -0400 Received: from colin.muc.de ([193.149.48.1]:47706 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1hEvrZ-00030Q-KL for 35194@debbugs.gnu.org; Fri, 12 Apr 2019 09:05:03 -0400 Received: (qmail 3530 invoked by uid 3782); 12 Apr 2019 13:04:59 -0000 Received: from acm.muc.de (p4FE15D0C.dip0.t-ipconnect.de [79.225.93.12]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 12 Apr 2019 15:04:58 +0200 Received: (qmail 18976 invoked by uid 1000); 12 Apr 2019 13:04:58 -0000 Date: Fri, 12 Apr 2019 13:04:58 +0000 To: Tau Subject: Re: bug#35194: CC Mode 5.33.1 (C++//l); Indentation of C++ methods with ref-qualifiers is broken. Message-ID: <20190412130458.GA18882@ACM> References: <20190408151325.6ff7ded6@ea7ababe> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190408151325.6ff7ded6@ea7ababe> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 35194 Cc: 35194@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Tau. Thanks for taking the trouble to report this bug (or lack of a feature), and thanks even more for cutting the test case down to an easily usable minimum, and also thanks for the C-c C-b CC Mode configuration dump. On Mon, Apr 08, 2019 at 15:13:25 +0300, Tau wrote: > Methods with ref-qualifiers (& and &&) seem to get indented with > "brace-list-intro" which, as I understand it, is used for > initializer lists and not code blocks. It is set to > "c-lineup-arglist-intro-after-paren" in GNU style which is the > default. Yes. brace-list-info is wrong, these lines should return defun-block-intro. > Functions that use the auto syntax for return types and return > a reference are affected as well. > // Example of incorrect indentation in a program: > #include > struct T { > void a_method() && { > std::cout << "rvalue ref\n"; > } > void a_method() const& { > std::cout << "lvalue const ref\n"; > } [ .... ] Would you please apply the patch below (which should apply cleanly to the Emacs 26.1 sources), byte-compile cc-engine.el, and try it out. Then please either confirm to me that it fixes the problem, or say what is still not right. (Feel free to send me private email if you want any help in applying the patch or byte-compiling the file.) Unfortunately, this isn't an "important enough" bug actually to get fixed in the Emacs-26 release branch. It will be committed to the master branch, which will eventually be released as Emacs 27.1. So please keep the patch, so that you can apply it to your copy of Emacs 26.2 which is due to be released "very soon". Here's the patch: diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 965886727d..e58a988a48 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -10446,7 +10446,8 @@ c-looking-at-or-maybe-in-bracelist (eq (char-after) ?\()) (setq braceassignp 'c++-noassign in-paren 'in-paren)) - ((looking-at c-pre-id-bracelist-key)) + ((looking-at c-pre-id-bracelist-key) + (setq braceassignp nil)) ((looking-at c-return-key)) ((and (looking-at c-symbol-start) (not (looking-at c-keywords-regexp))) @@ -10488,6 +10489,8 @@ c-looking-at-or-maybe-in-bracelist (setq pos (point)) (cond + ((not braceassignp) + nil) ((and after-type-id-pos (goto-char after-type-id-pos) (setq res (c-back-over-member-initializers)) @@ -10558,9 +10561,15 @@ c-looking-at-or-maybe-in-bracelist )))) nil) (t t)))))) - (if (and (eq braceassignp 'dontknow) - (/= (c-backward-token-2 1 t lim) 0)) - (setq braceassignp nil))) + (when (eq braceassignp 'dontknow) + (cond ((and + (not (eq (char-after) ?,)) + (save-excursion + (c-backward-syntactic-ws) + (eq (char-before) ?}))) + (setq braceassignp nil)) + ((/= (c-backward-token-2 1 t lim) 0) + (setq braceassignp nil))))) (cond (braceassignp @@ -10592,9 +10601,14 @@ c-looking-at-or-maybe-in-bracelist (and (consp res) (eq (car res) after-type-id-pos)))))) (cons bufpos (or in-paren inexpr-brace-list))) - ((eq (char-after) ?\;) - ;; Brace lists can't contain a semicolon, so we're done. - ;; (setq containing-sexp nil) + ((or (eq (char-after) ?\;) + ;; Brace lists can't contain a semicolon, so we're done. + (save-excursion + (c-backward-syntactic-ws) + (eq (char-before) ?})) + ;; They also can't contain a bare }, which is probably the end + ;; of a function. + ) nil) ((and (setq macro-start (point)) (c-forward-to-cpp-define-body) -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 12 12:28:04 2019 Received: (at 35194) by debbugs.gnu.org; 12 Apr 2019 16:28:04 +0000 Received: from localhost ([127.0.0.1]:56652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hEz23-0008KG-Ul for submit@debbugs.gnu.org; Fri, 12 Apr 2019 12:28:04 -0400 Received: from ea7aba.be ([172.104.149.205]:41238 helo=mail.ea7aba.be) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hEz22-0008Jp-B9 for 35194@debbugs.gnu.org; Fri, 12 Apr 2019 12:28:03 -0400 Received: from ea7ababe (unknown [178.210.132.50]) by mail.ea7aba.be (Postfix) with ESMTPSA id 026FE60940; Fri, 12 Apr 2019 16:28:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ea7aba.be; s=mail; t=1555086481; bh=U7dsV+rMjM8MfI9CIik9Myvw2Y2yXTmDvPUSqXFPkkY=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=Ot8DycmD2J1Hss1w+QRixODmgwQSX7GVY+YZpPTpFQdMrY9avFwRs94+5C0ppbRGS pmDhjFo6WS5b0uC1Td2IIcgCuxNHuEsMD1l7zrEmFuAGkXltIktEUEBkH+zm1I3yD9 ih7xtbgZGeBHolgyiyDsEOUkhQquGwsfkQW7kbC4= Date: Fri, 12 Apr 2019 19:27:59 +0300 From: Tau To: Alan Mackenzie Subject: Re: bug#35194: CC Mode 5.33.1 (C++//l); Indentation of C++ methods with ref-qualifiers is broken. Message-ID: <20190412192759.6e5a7249@ea7ababe> In-Reply-To: <20190412130458.GA18882@ACM> References: <20190408151325.6ff7ded6@ea7ababe> <20190412130458.GA18882@ACM> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35194 Cc: 35194@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri, 12 Apr 2019 13:04:58 +0000 Alan Mackenzie wrote: > Would you please apply the patch below (which should apply cleanly to > the Emacs 26.1 sources), byte-compile cc-engine.el, and try it out. Hi, Alan. Awesome job! I have applied the patch and tested it on a few C++ files. Everything looks good now. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 12 16:19:52 2019 Received: (at 35194-done) by debbugs.gnu.org; 12 Apr 2019 20:19:52 +0000 Received: from localhost ([127.0.0.1]:56805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hF2eN-0005Pz-TV for submit@debbugs.gnu.org; Fri, 12 Apr 2019 16:19:52 -0400 Received: from colin.muc.de ([193.149.48.1]:29267 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1hF2eK-0005Po-MU for 35194-done@debbugs.gnu.org; Fri, 12 Apr 2019 16:19:50 -0400 Received: (qmail 84853 invoked by uid 3782); 12 Apr 2019 20:19:46 -0000 Received: from acm.muc.de (p4FE15D0C.dip0.t-ipconnect.de [79.225.93.12]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 12 Apr 2019 22:19:45 +0200 Received: (qmail 7612 invoked by uid 1000); 12 Apr 2019 20:19:45 -0000 Date: Fri, 12 Apr 2019 20:19:45 +0000 To: Tau Subject: Re: bug#35194: CC Mode 5.33.1 (C++//l); Indentation of C++ methods with ref-qualifiers is broken. Message-ID: <20190412201945.GF4588@ACM> References: <20190408151325.6ff7ded6@ea7ababe> <20190412130458.GA18882@ACM> <20190412192759.6e5a7249@ea7ababe> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190412192759.6e5a7249@ea7ababe> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 35194-done Cc: 35194-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello again, Tau. On Fri, Apr 12, 2019 at 19:27:59 +0300, Tau wrote: > On Fri, 12 Apr 2019 13:04:58 +0000 > Alan Mackenzie wrote: > > Would you please apply the patch below (which should apply cleanly to > > the Emacs 26.1 sources), byte-compile cc-engine.el, and try it out. > Hi, Alan. Awesome job! I have applied the patch and tested it on a few > C++ files. Everything looks good now. Thanks for the testing! Just as a matter of interest, Emacs 26.2 was released this afternoon (European time). I've committed the patch to the Emacs master branch, and standalone CC Mode. I'm closing the bug. -- Alan Mackenzie (Nuremberg, Germany). From unknown Mon Aug 11 21:13:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 11 May 2019 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator