GNU bug report logs - #79438
31.0.50; incorrect c++-mode line indentation for member function template

Previous Next

Package: emacs;

Reported by: Geza Herman <geza.herman <at> gmail.com>

Date: Fri, 12 Sep 2025 18:10:02 UTC

Severity: normal

Found in version 31.0.50

To reply to this bug, email your comments to 79438 AT debbugs.gnu.org.

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#79438; Package emacs. (Fri, 12 Sep 2025 18:10:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Geza Herman <geza.herman <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 12 Sep 2025 18:10:03 GMT) Full text and rfc822 format available.

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

From: Geza Herman <geza.herman <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; incorrect c++-mode line indentation for member function
 template
Date: Fri, 12 Sep 2025 20:08:40 +0200
This little code, the "Foo(T);" line receives an extra level of 
indentation when using M-x c-indent-line-or-region:

struct Foo {
    template <typename T>
    Foo(T);
};

This worked correctly before, I found that 
555ec43a32ea8f3675c5a9d73ca30609eeaa9013 introduced this behavior.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79438; Package emacs. (Sat, 13 Sep 2025 06:36:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Geza Herman <geza.herman <at> gmail.com>, Alan Mackenzie <acm <at> muc.de>
Cc: 79438 <at> debbugs.gnu.org
Subject: Re: bug#79438: 31.0.50;
 incorrect c++-mode line indentation for member function template
Date: Sat, 13 Sep 2025 09:35:39 +0300
> Date: Fri, 12 Sep 2025 20:08:40 +0200
> From: Geza Herman <geza.herman <at> gmail.com>
> 
> This little code, the "Foo(T);" line receives an extra level of 
> indentation when using M-x c-indent-line-or-region:
> 
> struct Foo {
>      template <typename T>
>      Foo(T);
> };
> 
> This worked correctly before, I found that 
> 555ec43a32ea8f3675c5a9d73ca30609eeaa9013 introduced this behavior.

Thanks, I added Alan to the discussion.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79438; Package emacs. (Mon, 15 Sep 2025 19:32:02 GMT) Full text and rfc822 format available.

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

From: Alan Mackenzie <acm <at> muc.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 79438 <at> debbugs.gnu.org, Geza Herman <geza.herman <at> gmail.com>
Subject: Re: bug#79438: 31.0.50; incorrect c++-mode line indentation for
 member function template
Date: Mon, 15 Sep 2025 19:31:05 +0000
Hello, Eli and Geza.

On Sat, Sep 13, 2025 at 09:35:39 +0300, Eli Zaretskii wrote:
> > Date: Fri, 12 Sep 2025 20:08:40 +0200
> > From: Geza Herman <geza.herman <at> gmail.com>

> > This little code, the "Foo(T);" line receives an extra level of 
> > indentation when using M-x c-indent-line-or-region:

> > struct Foo {
> >      template <typename T>
> >      Foo(T);
> > };

> > This worked correctly before, I found that 
> > 555ec43a32ea8f3675c5a9d73ca30609eeaa9013 introduced this behavior.

Geza, thanks for taking the trouble to report this bug.  It looks like
it will be fairly easy to solve, by binding an existing CC Mode line-up
function to the syntactic symbol class-field-cont.  I will look at this
more thoroughly in the coming day or two.

> Thanks, I added Alan to the discussion.

Eli, thanks, as always, for telling me about the bug!

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 3 days ago.

Previous Next


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