Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Absent clang-format C++-lambdas indentations support #47123

Open Quuxplusone opened 3 years ago

Quuxplusone commented 3 years ago
Bugzilla Link PR48154
Status NEW
Importance P enhancement
Reported by Vladyslav Bondur (bondvladserg@mail.ru)
Reported on 2020-11-11 09:38:25 -0800
Last modified on 2020-11-11 09:38:25 -0800
Version unspecified
Hardware PC Windows NT
CC klimek@google.com
Fixed by commit(s)
Attachments .clang-format (7322 bytes, text/plain)
Blocks
Blocked by
See also
Created attachment 24154
example of used .clang-format configuration

We use Whitesmiths code formatting. Everything works fine except lambdas
namespace NS
  {
  class C
    {
    void foo()
      {
      for (...)
        {
        }
      if (...)
        {
        }
      auto bad_lambda = []
      {
        // several instructions to not collapse lambda into a single line
      };
      auto good_lambda = []
        {
        // several instructions to not collapse lambda into a single line
        };
      }
    }
  }

Actual result: Every parentheses is intended with 2 columns. Lambda parentheses
- no, they behave as bad_lambda example.

Expected result: as good_lambda in example.

.clang-format in attachment.
Quuxplusone commented 3 years ago

Attached .clang-format (7322 bytes, text/plain): example of used .clang-format configuration