[PATCH] D80950: [clang-format] [PR44542,38872] String << String always get a forced newline.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 3 08:12:24 PDT 2020


sammccall added a comment.

(Oops, hit enter too soon here... will edit the rest in)

Lack of tests is bad :-( This is http://github.com/llvm/llvm-project/commit/2603ee0dc6003 which dates back to clang-format early days, before there was good test coverage.

Obviously we can add tests for the existing behaviour, not sure whether it changes the analysis though.
FWIW at google we release clang-format from head weekly and regression test it by looking for changes in formatting of sampled files from a large codebase.
Certainly this isn't as good as unit-test coverage, though it has caught many bugs/style regressions in the past.

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

This irregularity is indeed annoying. Probably a lot of the time you want to break after `D`... unless it's `Indent` or so.

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

This example is not good evidence of anything IMO, it's just another not-really-function-like macro, with no evidence that this pattern is widely used.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80950/new/

https://reviews.llvm.org/D80950





More information about the cfe-commits mailing list