GNU bug report logs - #19867
c++-mode indentation issues with C++1x initializer lists

Previous Next

Packages: emacs, cc-mode;

Reported by: turner25 <at> gmail.com

Date: Sat, 14 Feb 2015 18:17:01 UTC

Severity: minor

Found in version 24.4.1

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


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

From: Alan Mackenzie <acm <at> muc.de>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: Simon <turner25 <at> gmail.com>, 19867 <at> debbugs.gnu.org
Subject: Re: bug#19867: c++-mode indentation issues with C++1x initializer
 lists
Date: Tue, 11 Mar 2025 20:15:35 +0000
Hello, Stefan.

On Tue, Mar 11, 2025 at 09:54:20 -0700, Stefan Kangas wrote:
> Stefan Kangas <stefankangas <at> gmail.com> writes:

> > Simon <turner25 <at> gmail.com> writes:

> >> Initializer lists use curly braces, but their contents do not indent properly with emacs' c++-mode.
> >> In short, one may use an initializer list to declare and initialize a vector of integers as such:
> >>   std::vector<int> Foo( { 1, 2, 3, 4, 5 } );

> >> Problems arise when the elements of the list span on multiple line and it gets even worse when the elements are lambda-expressions
> >> and nested initializer lists.
> >> The following code illustrate most cases and related situations.  The code below compiles without error or warning with gcc 4.8.3.

> > I had a look at the fairly long example provided here, and AFAICT, the
> > indentation is incorrect in the below cases (trimmed down from the
> > original).  Some of the examples of incorrect indentation were already
> > fixed.

> > Alan, could you perhaps take a look at this and see if this is something
> > that is fixable?  Thanks in advance.

> Alan, any chance you could look into the below cases?  Thanks in advance.

Yes, I'll do this.  Sorry I never replied to your post in 2020.  I
started looking at the bug then, but somehow didn't get very far with it.
Maybe it was because there were so many individual glitches in the
report.  Thanks for distilling the cases which still remain unfixed.

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 2 days ago.

Previous Next


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