This is an archive of the discontinued LLVM Phabricator instance.

[clang-format][PR41899] PointerAlignment: Left leads to useless space in lambda intializer expression
ClosedPublic

Authored by MyDeveloperDay on Sep 18 2019, 9:41 AM.

Details

Summary

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

auto lambda = [&a = a]() { a = 2; };

is formatted as

auto lambda = [& a = a]() { a = 2; };

With an extra space if PointerAlignment is set to Left

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.

Diff Detail

Repository
rC Clang

Event Timeline

MyDeveloperDay created this revision.Sep 18 2019, 9:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 18 2019, 9:41 AM
This revision is now accepted and ready to land.Sep 18 2019, 10:02 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 18 2019, 12:17 PM