[all-commits] [llvm/llvm-project] a70549: [clang-format] Fix DefSeparator empty line issues

ksyx via All-commits all-commits at lists.llvm.org
Mon Feb 7 06:23:36 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a70549ae43dfa551f3eacdfa7a7f2c0df073be8e
      https://github.com/llvm/llvm-project/commit/a70549ae43dfa551f3eacdfa7a7f2c0df073be8e
  Author: ksyx <18738953+ksyx at users.noreply.github.com>
  Date:   2022-02-07 (Mon, 07 Feb 2022)

  Changed paths:
    M clang/lib/Format/DefinitionBlockSeparator.cpp
    M clang/unittests/Format/DefinitionBlockSeparatorTest.cpp

  Log Message:
  -----------
  [clang-format] Fix DefSeparator empty line issues

- Add or remove empty lines surrounding union blocks.
- Fixes https://github.com/llvm/llvm-project/issues/53229, in which
  keywords like class and struct in a line ending with left brace or
  whose next line is left brace only, will be falsely recognized as
  definition line, causing extra empty lines inserted surrounding blocks
  with no need to be formatted.

Reviewed By: MyDeveloperDay, curdeius, HazardyKnusperkeks, owenpan
Differential Revision: https://reviews.llvm.org/D119067




More information about the All-commits mailing list