From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.bugs Subject: bug#8438: 24.0.50; C++ macro make indentation fail Date: Wed, 13 Apr 2011 02:25:19 -0700 Message-ID: <4DA56BFF.6050902@gmail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040405050800080700010209" X-Trace: dough.gmane.org 1302687464 20882 80.91.229.12 (13 Apr 2011 09:37:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Apr 2011 09:37:44 +0000 (UTC) Cc: Alan Mackenzie , 8438@debbugs.gnu.org To: Andrea Crotti Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 13 11:37:40 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q9wW3-0005AH-A4 for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Apr 2011 11:37:39 +0200 Original-Received: from localhost ([::1]:59670 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9wW2-0004XG-S2 for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Apr 2011 05:37:38 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:40824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9wVz-0004Wo-MP for bug-gnu-emacs@gnu.org; Wed, 13 Apr 2011 05:37:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q9wVu-0006An-5G for bug-gnu-emacs@gnu.org; Wed, 13 Apr 2011 05:37:35 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59295) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9wVm-00068x-7c; Wed, 13 Apr 2011 05:37:22 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Q9wKo-0000w8-GT; Wed, 13 Apr 2011 05:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Colascione Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Wed, 13 Apr 2011 09:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8438 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 8438-submit@debbugs.gnu.org id=B8438.13026867323562 (code B ref 8438); Wed, 13 Apr 2011 09:26:02 +0000 Original-Received: (at 8438) by debbugs.gnu.org; 13 Apr 2011 09:25:32 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q9wKK-0000vP-09 for submit@debbugs.gnu.org; Wed, 13 Apr 2011 05:25:32 -0400 Original-Received: from mail-pw0-f44.google.com ([209.85.160.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q9wKH-0000vA-LN for 8438@debbugs.gnu.org; Wed, 13 Apr 2011 05:25:30 -0400 Original-Received: by pwi5 with SMTP id 5so191826pwi.3 for <8438@debbugs.gnu.org>; Wed, 13 Apr 2011 02:25:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type; bh=YZ3Q8pAt0Nv1L3IqB1KBAB+CtI+jIF52CmDNCXLJc4k=; b=canZDJnrc8xbkkR/tmr3XbCwqAVsbgien0qXU0rOu87olzfC+NRgVgsVCZg/Gj9GsG 4tP4izedNF0soONKlODiO6IkbBt2C48IsOZHMQ+fbNR3F3CzYtpoIzYqvya9pkvxezmq ELaw8Q6aed4eeOszTSjyHeijYkuvtRLbPY9xk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type; b=cYFTCKMcRAZ8dIbPJFFMMKbbWLY7+mCRDfUapWm5Yam3FdRmOvM7SGd48p5GaX7VPH /tIH4TNzr+pW/2uxsnRC9tmylVLGmk7UtY/wTWRnUfdzbrHsdhq/y9uFDRQC6nlkAURT HRVvhRo7YzEbuwDxvP625T8aSRYdulCrehr8g= Original-Received: by 10.142.250.20 with SMTP id x20mr1354033wfh.391.1302686723508; Wed, 13 Apr 2011 02:25:23 -0700 (PDT) Original-Received: from [192.168.1.2] (c-67-183-23-114.hsd1.wa.comcast.net [67.183.23.114]) by mx.google.com with ESMTPS id n4sm568868wfl.14.2011.04.13.02.25.20 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Apr 2011 02:25:20 -0700 (PDT) User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 In-Reply-To: X-Enigmail-Version: 1.1.1 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 13 Apr 2011 05:26:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:45783 Archived-At: This is a multi-part message in MIME format. --------------040405050800080700010209 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 4/7/11 3:45 AM, Andrea Crotti wrote: > I send from my fully customized emacs but I also tested it with "emacs -Q". > A simple macro in C++ mode makes the indentation fail, this is what it > should be: > > --8<---------------cut here---------------start------------->8--- > #define OUT (std::cout << "DEBUG: (" << hwaddress << "):\t") > > PadNode::PadNode(const PadNodeID& _hwaddress, landmark_idx_t _land_idx, bool _is_mobile) > : Node(), The problem actually has nothing to do with the macro: c-forward-decl-or-cast-1 is choking on the const because it's mistaking it for something that might be part of a member function pointer. Because c-forward-decl-or-cast-1 fails inside c-just-after-func-arglist-p, c-guess-basic-offset tries the next best thing, which happens to be a template argument continuation. The attached patch resolves the issue. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iEYEARECAAYFAk2la/kACgkQ17c2LVA10VtGawCeLYuZ7f1QKHsFgkrYzgWCNevZ nwQAoNStOC5JvnSs1G5sU92UrogmFAQW =mxeQ -----END PGP SIGNATURE----- --------------040405050800080700010209 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="typo.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="typo.patch" === modified file 'lisp/progmodes/cc-engine.el' --- lisp/progmodes/cc-engine.el 2011-03-06 17:03:45 +0000 +++ lisp/progmodes/cc-engine.el 2011-04-13 09:18:47 +0000 @@ -6475,7 +6475,7 @@ ;; `c-font-lock-declarators'.) (while (and (looking-at c-type-decl-prefix-key) (if (and (c-major-mode-is 'c++-mode) - (match-beginning 2)) + (match-beginning 3)) ;; If the second submatch matches in C++ then ;; we're looking at an identifier that's a ;; prefix only if it specifies a member pointer. --------------040405050800080700010209--