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

            Bug ID: 32151
           Summary: AlwaysBreakLambda
           Product: clang
           Version: 4.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangb...@nondot.org
          Reporter: rianqu...@gmail.com
                CC: djas...@google.com, kli...@google.com,
                    llvm-bugs@lists.llvm.org

This is more of an enhancement than a bug, but it would be great if there was
an option like: AlwaysBreakLambda that did the following:

Before:
TEST_CASE("cout")
{
    CHECK_COUT("hello\n", [] { std::cout << "hello\n"; });
}

After:
TEST_CASE("cout")
{
    CHECK_COUT("hello\n", [] { 
        std::cout << "hello\n"; 
    });
}

Currently, clang format is always outputting the "before" case if it can fit on
a single line, and it just looks bad IMO. The "after" case is really what I
would like to see since I am defining a function. 

It also seems to do the following which is even worse IMO:

Odd Ball Case:
TEST_CASE("cout")
{
    CHECK_COUT(
        "slightly longer\n", [] { std::cout << "slightly longer\n"; });
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to