[llvm-bugs] [Bug 32684] New: [java] BraceWrapping: AfterFunction affects synchronized blocks

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Apr 17 05:30:56 PDT 2017


http://bugs.llvm.org/show_bug.cgi?id=32684

            Bug ID: 32684
           Summary: [java] BraceWrapping: AfterFunction affects
                    synchronized blocks
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jensfischer95 at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

It seems that synchronized blocks in Java are affected by BraceWrapping's
AfterFunction setting, rather than AfterControlStatement.

This config:

BreakBeforeBraces: Custom
BraceWrapping:
  AfterControlStatement: false
  AfterFunction: true

Results in this formatting:

class Foo {
  void bar()
  {
    synchronized (this)
    {
      System.out.println("");
      System.out.println("");
    }
  }
}

I would expect the { of the synchronized block to remain on the same line here.

clang-format version: 5.0.0 (1cd6beccb6bb876db3bbfa763e8979)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170417/b46cae93/attachment.html>


More information about the llvm-bugs mailing list