[PATCH] D77682: [clang-format] Always break line after enum opening brace

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 8 03:12:40 PDT 2020


MyDeveloperDay added a comment.

Did you try:

  BreakBeforeBraces: Custom
  BraceWrapping:
    AfterEnum: true

with AfterEnum:true

  $ clang-format enum.cpp
  enum
  {
    A,
  };
  
  enum
  {
    B,
    C,
    D
  };
  
  enum
  {
    E
  };

with AfterEnum:false

  $ clang-format enum.cpp
  enum {
    A,
  };
  
  enum { B, C, D };
  
  enum { E };

I believe example is not following the style of BraceWrapping.AfterEnum by virtue of the trailing `,`

I think I'd expect the correct behaviour to be

  enum { A, };

or

  enum { 
     A, 
  };

depending on that setting


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77682





More information about the cfe-commits mailing list