[all-commits] [llvm/llvm-project] a4c87f: [clang-format] Fix consecutive alignments in #else...

Owen via All-commits all-commits at lists.llvm.org
Mon May 8 19:46:02 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a4c87f8ccaccc76fd7d1c6c2e639ca84b9ec7794
      https://github.com/llvm/llvm-project/commit/a4c87f8ccaccc76fd7d1c6c2e639ca84b9ec7794
  Author: Owen Pan <owenpiano at gmail.com>
  Date:   2023-05-08 (Mon, 08 May 2023)

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

  Log Message:
  -----------
  [clang-format] Fix consecutive alignments in #else blocks

Since 3.8 or earlier, clang-format has been lumping all #else, #elif,
etc blocks together when doing whitespace replacements and causing
consecutive alignments across #else blocks.

Commit c077975 partially addressed the problem but also triggered
"regressions".

This patch fixes the root cause of the problem and "reverts" c077975
(except for the unit tests).

Fixes #36070.
Fixes #55265.
Fixes #60721.
Fixes #61498.

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




More information about the All-commits mailing list