From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie <acm@muc.de> Newsgroups: gmane.emacs.bugs Subject: bug#34594: cc-mode needs to support "final" in C++ classes Date: Fri, 26 Apr 2019 14:29:03 +0000 Message-ID: <20190426142903.GB4720__2098.51819542877$1556289101$gmane$org@ACM> References: <bddcd0f6ba238510a0fecbb63ef3bce5.squirrel@dancol.org> <b5cedc33f9814f598ca543f59d44e045.squirrel@dancol.org> <40982e49-bc1e-5164-bfc7-428860ce6391@dancol.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="218580"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 34594-done@debbugs.gnu.org To: Daniel Colascione <dancol@dancol.org> Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 26 16:31:36 2019 Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org> Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>) id 1hK1t1-000uhU-0q for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Apr 2019 16:31:35 +0200 Original-Received: from localhost ([127.0.0.1]:47945 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>) id 1hK1t0-0008Cm-0q for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Apr 2019 10:31:34 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1hK1rf-0007Hc-KA for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2019 10:30:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1hK1re-0002kh-KQ for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2019 10:30:11 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48016) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1hK1rX-0002Zz-FA; Fri, 26 Apr 2019 10:30:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1hK1rX-0005uU-8B; Fri, 26 Apr 2019 10:30:03 -0400 Resent-From: Alan Mackenzie <acm@muc.de> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-To: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Fri, 26 Apr 2019 14:30:02 +0000 Resent-Message-ID: <handler.34594.D34594.155628894722626.done@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 34594 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: confirmed Mail-Followup-To: 34594@debbugs.gnu.org, acm@muc.de, dancol@dancol.org Original-Received: via spool by 34594-done@debbugs.gnu.org id=D34594.155628894722626 (code D ref 34594); Fri, 26 Apr 2019 14:30:02 +0000 Original-Received: (at 34594-done) by debbugs.gnu.org; 26 Apr 2019 14:29:07 +0000 Original-Received: from localhost ([127.0.0.1]:33327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1hK1qd-0005ss-30 for submit@debbugs.gnu.org; Fri, 26 Apr 2019 10:29:07 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:38703 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from <acm@muc.de>) id 1hK1qb-0005sj-OI for 34594-done@debbugs.gnu.org; Fri, 26 Apr 2019 10:29:06 -0400 Original-Received: (qmail 88641 invoked by uid 3782); 26 Apr 2019 14:29:03 -0000 Original-Received: from acm.muc.de (p4FE15E52.dip0.t-ipconnect.de [79.225.94.82]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 26 Apr 2019 16:29:03 +0200 Original-Received: (qmail 8932 invoked by uid 1000); 26 Apr 2019 14:29:03 -0000 Content-Disposition: inline In-Reply-To: <40982e49-bc1e-5164-bfc7-428860ce6391@dancol.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>, <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe> List-Archive: <http://lists.gnu.org/archive/html/bug-gnu-emacs/> List-Post: <mailto:bug-gnu-emacs@gnu.org> List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>, <mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe> Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org> Xref: news.gmane.org gmane.emacs.bugs:158297 Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/158297> Hello, Daniel. The bug has been fixed, so I'm closing it. -- Alan Mackenzie (Nuremberg, Germany). On Fri, Apr 12, 2019 at 19:54:36 -0700, Daniel Colascione wrote: > + Alan > On 2/20/19 11:34 AM, Daniel Colascione wrote: > >> Consider this: > >> > >> 1 struct QueryCache final : BasePyObject, SupportsGcClear, > >> 2 HasDict, SupportsWeakRefs > >> > >> Without the "final", line 2 is classified as inher-cont. With the > >> "final", it gets topmost-intro-cont and wrong indentation. > > > > Proposed fix: > > > > diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el > > index b4c12896f3..121888d825 100644 > > --- a/lisp/progmodes/cc-engine.el > > +++ b/lisp/progmodes/cc-engine.el > > @@ -12268,6 +12268,9 @@ c-guess-basic-syntax > > (if (eq (char-after) ?<) > > (zerop (c-forward-token-2 1 t indent-point)) > > t) > > + (if (looking-at "final\\>[^_]") > > + (c-forward-token-2 1 nil indent-point) > > + t) > > (eq (char-after) ?:)))) > > (goto-char placeholder) > > (c-add-syntax 'inher-cont (c-point 'boi))) > >