[llvm-bugs] [Bug 27640] New: clang-format lambda block brace regression with "BreakBeforeBraces: Allman"

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 4 05:00:41 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27640

            Bug ID: 27640
           Summary: clang-format lambda block brace regression with
                    "BreakBeforeBraces: Allman"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vittorio.romeo at outlook.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org
    Classification: Unclassified

clang-format 3.7 correctly formatted the following code:

void x()
{
    return something([](auto) -> decltype(auto) 
    {
        something();
        something();
    });
}

Note the breaks inside the lambda body.



clang-format 3.9 does not respect the Allman setting for lambda bodies:

void x()
{
    return something([](auto) -> decltype(auto) {
        something();
        something();
    });
}



I think that version one is the correct hehavior (and is the one I desire).
Please add a flag like "BreakBeforeLambdaBody" in order to accomodate multiple
coding styles.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160504/65d20164/attachment.html>


More information about the llvm-bugs mailing list