bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#13367: 24.1; Wrong switch/case indentation inside some c++11 lambdas


From: Stefan Kangas
Subject: bug#13367: 24.1; Wrong switch/case indentation inside some c++11 lambdas
Date: Mon, 30 Sep 2019 18:40:59 +0200

Denis Zalevskiy <denis.zalevskiy@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.

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

Best regards,
Stefan Kangas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]