Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Inconsistent lambda capture list formatting with trailing return type deduction #28589

Open Quuxplusone opened 8 years ago

Quuxplusone commented 8 years ago
Bugzilla Link PR28590
Status NEW
Importance P normal
Reported by Vittorio Romeo (vittorio.romeo@outlook.com)
Reported on 2016-07-17 13:56:44 -0700
Last modified on 2016-07-17 13:56:44 -0700
Version 3.8
Hardware PC Linux
CC djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments test_fmt_lambda.cpp (186 bytes, text/x-c++src)
Blocks
Blocked by
See also

Created attachment 16756 Code example

Consider the following code, formatted by clang-format:


int main() { int x, y;

auto l0 = [x, y](auto z)
{ /* ... */ };

auto l1 = [x, y](auto z) -> int
{ /* ... */ };

auto l2 = [ x, y ](auto z) -> auto {/* ... */};

}


Removing the -> auto or changing auto to int allows the lambda to be formatted as expected.

Might be related to bug #20450: https://llvm.org/bugs/show_bug.cgi?id=20450

Quuxplusone commented 8 years ago

Attached test_fmt_lambda.cpp (186 bytes, text/x-c++src): Code example