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

            Bug ID: 41899
           Summary: [clang-format] PointerAlignment: Left leads to useless
                    space in lambda intializer expression
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedb...@nondot.org
          Reporter: dennis.fels...@sap.com
                CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org

$ cat .clang-format
Language: Cpp
BasedOnStyle: WebKit
$ cat x.cpp
int main()
{
    auto a = 1;
    auto lambda = [&a = a]() { a = 2; };
}
$ clang-format x.cpp
int main()
{
    auto a = 1;
    auto lambda = [& a = a]() { a = 2; };
}

The space "& a" looks strange when there is no type in the lambda's intializer
expression. This can be worked around with by setting "PointerAlignment:
Right", but ideally "PointerAlignment: Left" would not add a space in this
case.

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

Reply via email to