GNU bug report logs - #13367
24.1; Wrong switch/case indentation inside some c++11 lambdas

Previous Next

Packages: cc-mode, emacs;

Reported by: Denis Zalevskiy <denis.zalevskiy <at> jollamobile.com>

Date: Sun, 6 Jan 2013 12:03:02 UTC

Severity: normal

Found in version 24.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Denis Zalevskiy <denis.zalevskiy <at> jollamobile.com>, 13367-done <at> debbugs.gnu.org
Subject: bug#13367: 24.1; Wrong switch/case indentation inside some c++11 lambdas
Date: Mon, 30 Sep 2019 18:59:02 +0000
Hello, Stefan.

On Mon, Sep 30, 2019 at 18:40:59 +0200, Stefan Kangas wrote:
> Denis Zalevskiy <denis.zalevskiy <at> jollamobile.com> writes:

> > Just create c++ file and enter:
> >
> > #include <vector>
> > #include <algorithm>
> >
> > int main()
> > {
> >     std::vector<int> v;
> >     std::for_each(v.begin(), v.end(),
> >                   [](int i) {
> >                       switch (i) {
> >                       case 1:
> >                           break; // (1) ok: syntactic symbol is statement-case-intro
> >                       }
> >                   });
> >     auto fn = [](int i) {
> >         switch (i) {
> >         case 1:
> >         break;  // (2) wrong: syntactic symbol is brace-list-entry
> >         }
> >     };
> >
> >     [](int i) {
> >         switch (i) {
> >         case 1:
> >             break; // (3) ok: syntactic symbol is statement-case-intro
> >         }
> >     };
> >     return 0;
> > }
> >
> > So, while (1) and (3) are parsed fine, (2) is parsed in a wrong way.

> I can't reproduce this on current master, so I'm going to assume that
> this has been fixed in the 6 years since this was reported and close
> this bug.

This has been fixed.  I just can't say when and how, without a lot of
work.

> If this is still an issue, please reopen the bug report.

> Best regards,
> Stefan Kangas

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 5 years and 232 days ago.

Previous Next


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