[llvm-bugs] [Bug 25018] New: short lambda expressions don't mix well with clang-format's interpretation of Allman braces

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 1 17:17:31 PDT 2015


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

            Bug ID: 25018
           Summary: short lambda expressions don't mix well with
                    clang-format's interpretation of Allman braces
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: seth.cantrell at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org
    Classification: Unclassified

Clang-format's interpretation of Allman style braces includes forcing short
lambdas to put their braces on new lines. Of course the Allman style was
developed before lambdas were a thing in C++, so it doesn't specify how to
handle lambdas.

    foo([&]() { f(i); });

gets re-formatted as:

    foo([&]()
        {
            f(i);
        });


There ought to be an option to control this, similar to the other
'allowShortXxxOnOneLine' options.

There also ought to be an option for short classes/structs.

-- 
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/20151002/7c8d8b52/attachment.html>


More information about the llvm-bugs mailing list