From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.bugs Subject: bug#34594: cc-mode needs to support "final" in C++ classes Date: Fri, 12 Apr 2019 19:54:36 -0700 Message-ID: <40982e49-bc1e-5164-bfc7-428860ce6391@dancol.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="186931"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 Cc: Alan Mackenzie , 34594@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 13 04:55:20 2019 Return-path: 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 ) id 1hF8p3-000mTs-Ef for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Apr 2019 04:55:18 +0200 Original-Received: from localhost ([127.0.0.1]:45763 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hF8p2-00057x-5S for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Apr 2019 22:55:16 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hF8ow-00057s-NX for bug-gnu-emacs@gnu.org; Fri, 12 Apr 2019 22:55:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hF8ov-0002ye-S7 for bug-gnu-emacs@gnu.org; Fri, 12 Apr 2019 22:55:10 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43872) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hF8on-0002wN-Mg; Fri, 12 Apr 2019 22:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hF8on-0006cI-Jo; Fri, 12 Apr 2019 22:55:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Colascione Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sat, 13 Apr 2019 02:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34594 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: confirmed Original-Received: via spool by 34594-submit@debbugs.gnu.org id=B34594.155512408925413 (code B ref 34594); Sat, 13 Apr 2019 02:55:01 +0000 Original-Received: (at 34594) by debbugs.gnu.org; 13 Apr 2019 02:54:49 +0000 Original-Received: from localhost ([127.0.0.1]:57416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hF8ob-0006bp-2Q for submit@debbugs.gnu.org; Fri, 12 Apr 2019 22:54:49 -0400 Original-Received: from dancol.org ([96.126.100.184]:33830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hF8oX-0006bc-JT for 34594@debbugs.gnu.org; Fri, 12 Apr 2019 22:54:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:Subject; bh=CRkPjdFAn1TmX+bUtnZGVeoZmQ4vPvqroJYFbHTnsm8=; b=ZTur1jALyZ/DknukJjKqAqi++IfU1MmBpwLs2J4wWgEXn8DE+cbvg7hZ59I+LpZTaDlJHr6uL/6NbgjHpIDaDysJoohZK14MBuW6v5GQZiVR6EJuMh+RvlmGXdIyNhAHRbfBqtfPuA37AXpfsvtM25siMhLgO1HdWmNscDF/8un3AGV8fU9QnZF8U7s+1PoYqh3QzdTbhyHWIAr7jX+yGaeV/p02dXQJPS+af0YZOqum03c2lh3RQclnOORSOeMfPLiy+qK20udbLzZve22xD4kUv+bIzdQmDzGCn5rjpYtgDZP3fj9MTgoLZlyZZRBhB24LbI2x4kr1rg5Nk2rUrg==; Original-Received: from [2604:4080:1321:9a00:fc2a:787c:f84c:2105] by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1hF8oV-0003Wo-Fh; Fri, 12 Apr 2019 19:54:43 -0700 In-Reply-To: Content-Language: en-US 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" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:157570 Archived-At: + 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))) >