[PATCH] D109951: [clang-format] Constructor initializer lists format with pp directives

Josh Learn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 17 00:42:04 PDT 2021


guitard0g added a comment.

@MyDeveloperDay This is an issue a coworker pointed out to me. Previously this code:

  Foo::Foo(int x)
      : _x { x }
  #if DEBUG
      , _y { 0 }
  #endif
  {
  }

would format into the following:

  Foo::Foo(int x)
      : _x
  {
      x
  }
  #if DEBUG
  , _y
  {
      0
  }
  #endif
  {
  }

whereas this code without the preprocessor directive:

  Foo::Foo(int x)
      : _x { x }
      , _y { 0 }
  {
  }

Is properly formatted with no changes made by clang-format.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109951



More information about the cfe-commits mailing list