[llvm-bugs] [Bug 31133] New: Continuation formatting doesn't respect AlignAfterOpenBracket

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 23 02:54:02 PST 2016


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

            Bug ID: 31133
           Summary: Continuation formatting doesn't respect
                    AlignAfterOpenBracket
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: griwes at griwes.info
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17636
  --> https://llvm.org/bugs/attachment.cgi?id=17636&action=edit
an example

When the attached example is formatted, no matter what value
AlignAfterOpenBracket is, running clang-format results in the following:

auto f()
{
    return some_function(some_future
                             .then([] {
                                 int a = 1;
                                 return a;
                             })
                             .then([](auto a) {
                                 int b = a * 12;
                                 return b;
                             }));
}

Honestly, I'm not sure whether this falls into scope of AlignAfterOpenBracket;
if it does, then this is clearly a bug; if it doesn't, then I'd like to request
a configuration option to control this behavior.

Expected result for DontAlign:

auto f()
{
    return some_function(some_future
        .then([] {
            int a = 1;
            return a;
        })
        .then([](auto a) {
            int b = a * 12;
            return b;
        }));
}

Expected result for AlwaysBreak:

auto f()
{
    return some_function(
        some_future
            .then([] {
                int a = 1;
                return a;
            })
            .then([](auto a) {
                int b = a * 12;
                return b;
            }));
}

-- 
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/20161123/9d2bd067/attachment-0001.html>


More information about the llvm-bugs mailing list