[all-commits] [llvm/llvm-project] 4b9764: [clang-format] Fix overlapping replacements before...

Owen via All-commits all-commits at lists.llvm.org
Sat Jun 3 12:33:36 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4b9764959dc4b8783e18747c1742ab164e4bc4ee
      https://github.com/llvm/llvm-project/commit/4b9764959dc4b8783e18747c1742ab164e4bc4ee
  Author: Owen Pan <owenpiano at gmail.com>
  Date:   2023-06-03 (Sat, 03 Jun 2023)

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

  Log Message:
  -----------
  [clang-format] Fix overlapping replacements before PPDirectives

If the first token of an annotated line is finalized, reuse its
NewlinesBefore value to avoid potential overlapping whitespace
replacements before preprocessor branching directives.

Fixes #62892.

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




More information about the All-commits mailing list