[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 17 08:25:21 PDT 2024


dmasloff wrote:

> Running `FormatTests` failed:
> 
> ```
> [ RUN      ] FormatTest.WrapNamespaceBodyWithEmptyLinesNever
> Assertion failed: (TheLine->MatchingClosingBlockLineIndex > 0), function tryFitMultipleLinesInOne, file UnwrappedLineFormatter.cpp, line 390.
> ```

@owenca I looked through this error, fortunately it is not connected with code changes introduced in my pr, but with additional test, which I wrote. Formatting this test `assert` fails both in my code and in llvm-project/main. The problem occurs in this [test](https://github.com/llvm/llvm-project/pull/106145/files#diff-3f6f57cda9809a57c5b79e22b4181b3f3aaac7216262d0ef44108f39b0443e9bR28140) during formatting of the empty namespace that stands right in the begging of file with `CompactNamespaces: true` option. As `TheLine->MatchingClosingBlockLineIndex` in this case equals 0, because file consists of just one line. I will remove this test from my pr

https://github.com/llvm/llvm-project/pull/106145


More information about the cfe-commits mailing list