[all-commits] [llvm/llvm-project] 27f547: [clang-format] Break after string literals with tr...

kadir çetinkaya via All-commits all-commits at lists.llvm.org
Mon Jan 8 02:11:16 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 27f547968cce89d4706ae2b27a0c15254d1670ee
      https://github.com/llvm/llvm-project/commit/27f547968cce89d4706ae2b27a0c15254d1670ee
  Author: kadir çetinkaya <kadircet at google.com>
  Date:   2024-01-08 (Mon, 08 Jan 2024)

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

  Log Message:
  -----------
  [clang-format] Break after string literals with trailing line breaks (#76795)

This restores a subset of functionality that was forego in
d68826dfbd987377ef6771d40c1d984f09ee3b9e.

Streaming multiple string literals is rare enough in practice, hence
that change makes sense in general. But it seems people were
incidentally relying on this for having line breaks after string
literals that ended with `\n`.

This patch tries to restore that behavior to prevent regressions in the
upcoming LLVM release, until we can implement some configuration based
approach as proposed in https://github.com/llvm/llvm-project/pull/69859.




More information about the All-commits mailing list