Userbla added a comment.

In D93938#2832825 <https://reviews.llvm.org/D93938#2832825>, @Userbla wrote:

> I applied this fix locally to a branch based off llvm 11.x and the 
> `FormatTest.FormatsTypedefEnum` test now fails.

So this test is failing:

  TEST_F(FormatTest, LongEnum) {
    FormatStyle Style = getLLVMStyle();
    Style.AllowShortEnumsOnASingleLine = true;
    Style.ColumnLimit = 40;
  
    Style.BreakBeforeBraces = FormatStyle::BS_Custom;
    Style.BraceWrapping.AfterEnum = false;
  
    verifyFormat("enum {\n"
                 "  ZERO = 0,\n"
                 "  ONE = 1,\n"
                 "  TWO = 2,\n"
                 "  THREE = 3\n"
                 "} LongEnum;",
                 Style);
    Style.BreakBeforeBraces = FormatStyle::BS_Custom;
    Style.BraceWrapping.AfterEnum = true;
    verifyFormat("enum\n"
                 "{\n"
                 "  ZERO = 0,\n"
                 "  ONE = 1,\n"
                 "  TWO = 2,\n"
                 "  THREE = 3\n"
                 "} LongEnum;",
                 Style);
  }

It fails in the second case because we don't respect the 'AfterEnum = true' and 
collapse the brace. It appears there is buggy logic in the 
`remainingLineCharCount` stuff which others have already been commenting on


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93938

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to