[LLVMbugs] [Bug 14745] New: Formatting empty function bodies

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Dec 29 12:54:50 PST 2012


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

             Bug #: 14745
           Summary: Formatting empty function bodies
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: grosser at fim.uni-passau.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9772
  --> http://llvm.org/bugs/attachment.cgi?id=9772
Test file to reporduce the bug

// In LLVM it is common to use '{}' to write an empty function body.
A::A : numberA(10), numberB(10), numberC(10), numberD(10), numberE(10),
    numberF(10) {}

clang-format turns this currently into

A::A : numberA(10), numberB(10), numberC(10), numberD(10), numberE(10),
    numberF(10) {
}

I did a simple grep:

$ grep -R '{}' * llvm/lib/ | wc
    830    4400   73778

Most of these patches are due to the above pattern. With more than 800 matches
the pattern is very common and seems worth supporting in clang-format.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list