[all-commits] [llvm/llvm-project] db41c0: [clang-format] PR35514 brace-init member initializ...

MyDeveloperDay via All-commits all-commits at lists.llvm.org
Thu Dec 17 01:40:19 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: db41c0b357d55ccd6206ff262dc50ed38f0d5474
      https://github.com/llvm/llvm-project/commit/db41c0b357d55ccd6206ff262dc50ed38f0d5474
  Author: mydeveloperday <mydeveloperday at gmail.com>
  Date:   2020-12-17 (Thu, 17 Dec 2020)

  Changed paths:
    M clang/lib/Format/UnwrappedLineParser.cpp
    M clang/unittests/Format/FormatTest.cpp

  Log Message:
  -----------
  [clang-format] PR35514 brace-init member initializers in function-try-blocks are not formatted correctly

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

Initializer lists with a try-block are incorrectly formatted.

e.g.

```
Foo(int abc, int def) try : _abc(abc), _def{def}, _ghi{1} {
  callA();
  callB();
} catch (std::exception&) {
}
```

is formatted as:

```
Foo(int abc, int def) try : _abc(abc), _def { def }
, _ghi{1} {
  callA();
  callB();
}
catch (std::exception&) {
}
```

This revision adds support in the parseTryCatch for braced initializers in the initializer list

Reviewed By: curdeius, HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D93296




More information about the All-commits mailing list