[PATCH] D134626: [clang-format] Correctly indent closing brace of compound requires

Emilia Dreamer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 27 00:02:02 PDT 2022


rymiel added a comment.

I built 2 versions of clang-format, before and after this patch, and made 2 separate clones of all of LLVM+clang and ran them through either, removing all `.clang-format`s, then ran a recursive diff.

I found 1 difference, in a test case at `clang/test/CodeGen/constrained-math-builtins.c` and reduced it to the following:

clang-format before the patch produced this:

  int foo() { ; };
  
    // Comment
  
  #preprocessor

clang-format after this patch produced this:

  int foo() { ; };
  
  // Comment
  
  #preprocessor

Very specific requirements here, needing a comment which follows a function with a non-empty body and with a (redundant) trailing semicolon, followed by any preprocessor directive.

Nevertheless, the output seems to make more sense *with* the patch, so I think this counts as a bug fix rather than a regression?

My testing surely isn't perfect but this was the only difference I found (besides instances of the specific bug that this patch was intended to fix)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134626



More information about the cfe-commits mailing list