unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniel Colascione <dan.colascione@gmail.com>
To: Andrea Crotti <andrea.crotti.0@gmail.com>
Cc: Alan Mackenzie <acm@muc.de>, 8438@debbugs.gnu.org
Subject: bug#8438: 24.0.50; C++ macro make indentation fail
Date: Wed, 13 Apr 2011 02:25:19 -0700	[thread overview]
Message-ID: <4DA56BFF.6050902@gmail.com> (raw)
In-Reply-To: <sa0oc4ipcfw.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1097 bytes --]

-----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-----

[-- Attachment #2: typo.patch --]
[-- Type: text/plain, Size: 543 bytes --]

=== 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.


  reply	other threads:[~2011-04-13  9:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-07 10:45 bug#8438: 24.0.50; C++ macro make indentation fail Andrea Crotti
2011-04-13  9:25 ` Daniel Colascione [this message]
2011-04-13  9:44   ` Andrea Crotti
2011-04-24 18:13   ` Chong Yidong
2011-04-25  0:41     ` Daniel Colascione
2011-04-25  7:59       ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DA56BFF.6050902@gmail.com \
    --to=dan.colascione@gmail.com \
    --cc=8438@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=andrea.crotti.0@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).