GNU bug report logs - #14626
CC Mode 5.32.5 (C++/l); indentation problem involving override

Previous Next

Packages: cc-mode, emacs;

Reported by: Michael Welsh Duggan <mwd <at> md5i.com>

Date: Sat, 15 Jun 2013 16:07:01 UTC

Severity: normal

Done: Alex <agrambot <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14626 in the body.
You can then email your comments to 14626 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14626; Package emacs. (Sat, 15 Jun 2013 16:07:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Welsh Duggan <mwd <at> md5i.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 15 Jun 2013 16:07:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Welsh Duggan <mwd <at> md5i.com>
To: bug-gnu-emacs <at> gnu.org
Subject: CC Mode 5.32.5 (C++/l); indentation problem involving override
Date: Sat, 15 Jun 2013 12:06:33 -0400
Date: Sat, 15 Jun 2013 12:03:45 -0400
Message-ID: <87a9mrqs2m.fsf <at> maru.md5i.com>
User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux)

In c++-mode, the following class gets indented correctly:

class Foo
{
  Foo
  foo()
    const;
};

as does this:

class Foo
{
  Foo *
  foo()
    const;
};

and this:

class Foo
{
  Foo
  foo()
    const
    override;
};


But the following does not:

class Foo
{
  Foo *
  foo()
  const
  override;
};


Emacs  : GNU Emacs 24.3.50.1 (i686-pc-linux-gnu, X toolkit)
 of 2013-06-11 on maru
Package: CC Mode 5.32.5 (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:
==============
-- 
Michael Welsh Duggan
(md5i <at> md5i.com)




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#14626; Package emacs,cc-mode. (Sun, 16 Jun 2013 04:49:02 GMT) Full text and rfc822 format available.

Message #8 received at 14626 <at> debbugs.gnu.org (full text, mbox):

From: Michael Welsh Duggan <mwd <at> md5i.com>
To: Michael Welsh Duggan <mwd <at> md5i.com>
Cc: 14626 <at> debbugs.gnu.org
Subject: Re: bug#14626: CC Mode 5.32.5 (C++/l);
 indentation problem involving override
Date: Sun, 16 Jun 2013 00:48:10 -0400
Michael Welsh Duggan <mwd <at> md5i.com> writes:

> Date: Sat, 15 Jun 2013 12:03:45 -0400
> Message-ID: <87a9mrqs2m.fsf <at> maru.md5i.com>
> User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux)
>
> In c++-mode, the following class gets indented correctly:
>
> class Foo
> {
>   Foo
>   foo()
>     const;
> };
>
> as does this:
>
> class Foo
> {
>   Foo *
>   foo()
>     const;
> };
>
> and this:
>
> class Foo
> {
>   Foo
>   foo()
>     const
>     override;
> };
>
>
> But the following does not:
>
> class Foo
> {
>   Foo *
>   foo()
>   const
>   override;
> };

It looks to me that "noexcept", "override", and "final" may need to be
added to c-type-modifier-kwds.  Or maybe more appropriately in
c-type-decl-suffix-key, since they can only appear at the end of a
declaration.  A brief scan through cc-langs.el shows that there might
need to be a few other new c++11 symbols added as well, such as
"constexpr".   "decltype" might be particularly troublesome, as it is a
type that includes an argument in parentheses.

Please note that "noexcept", like "throw", can have a parenthetical
expression after it.

-- 
Michael Welsh Duggan
(md5i <at> md5i.com)




Reply sent to Alex <agrambot <at> gmail.com>:
You have taken responsibility. (Mon, 22 Aug 2016 04:14:01 GMT) Full text and rfc822 format available.

Notification sent to Michael Welsh Duggan <mwd <at> md5i.com>:
bug acknowledged by developer. (Mon, 22 Aug 2016 04:14:02 GMT) Full text and rfc822 format available.

Message #13 received at 14626-done <at> debbugs.gnu.org (full text, mbox):

From: Alex <agrambot <at> gmail.com>
To: Michael Welsh Duggan <mwd <at> md5i.com>
Cc: 14626-done <at> debbugs.gnu.org
Subject: Re: bug#14626: CC Mode 5.32.5 (C++/l);
 indentation problem involving override
Date: Sun, 21 Aug 2016 22:13:16 -0600
Michael Welsh Duggan <mwd <at> md5i.com> writes:

> Date: Sat, 15 Jun 2013 12:03:45 -0400
> Message-ID: <87a9mrqs2m.fsf <at> maru.md5i.com>
> User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux)
>
> In c++-mode, the following class gets indented correctly:
>
> class Foo
> {
>   Foo
>   foo()
>     const;
> };
>
> as does this:
>
> class Foo
> {
>   Foo *
>   foo()
>     const;
> };
>
> and this:
>
> class Foo
> {
>   Foo
>   foo()
>     const
>     override;
> };
>
>
> But the following does not:
>
> class Foo
> {
>   Foo *
>   foo()
>   const
>   override;
> };

This indents correctly since 24.4.

> It looks to me that "noexcept", "override", and "final" may need to be
> added to c-type-modifier-kwds.  Or maybe more appropriately in
> c-type-decl-suffix-key, since they can only appear at the end of a
> declaration.  A brief scan through cc-langs.el shows that there might
> need to be a few other new c++11 symbols added as well, such as
> "constexpr".   "decltype" might be particularly troublesome, as it is a
> type that includes an argument in parentheses.

> Please note that "noexcept", like "throw", can have a parenthetical
> expression after it.

It appears that these keywords (apart from decltype) were added in time
for 25.1. decltype appears to be in master.

I'm closing the bug due to the above. Please re-open if you disagree.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 19 Sep 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 331 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.