[llvm-bugs] [Bug 41899] New: [clang-format] PointerAlignment: Left leads to useless space in lambda intializer expression
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu May 16 03:55:57 PDT 2019
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: unassignedbugs at nondot.org
Reporter: dennis.felsing at sap.com
CC: htmldeveloper at gmail.com, llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190516/904ee776/attachment.html>
More information about the llvm-bugs
mailing list