[PATCH] D123676: [clang-format] Fix WhitespaceSensitiveMacros not being honoured when macro closing parenthesis is followed by a newline.

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 16 08:03:25 PDT 2022


krasimir added a comment.

It looks like this regressed the following example by adding an unwanted level of indentation to the `#elif B` branch:

  % ./clang-format --version
  clang-format version 15.0.0 (https://github.com/llvm/llvm-project.git 50cd52d9357224cce66a9e00c9a0417c658a5655)
  % cat test.cc             
  #define MACRO_BEGIN
  
  MACRO_BEGIN
  
  namespace internal {
  
  #if A
  int f() { return 0; }
  #elif B
  int f() { return 1; }
  #endif
  
  }  // namespace internal
  % ./clang-format test.cc
  #define MACRO_BEGIN
  
  MACRO_BEGIN
  
  namespace internal {
  
  #if A
  int f() { return 0; }
  #elif B
    int f() { return 1; }
  #endif
  
  } // namespace internal
  % 

@curdeius could you please take a look?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123676



More information about the cfe-commits mailing list