[llvm-bugs] [Bug 37702] New: Allow one-line functions in class definition

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 6 08:55:19 PDT 2018


            Bug ID: 37702
           Summary: Allow one-line functions in class definition
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: matthew.woehlke at kitware.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

I'm having a number of issues trying to get clang-format to behave reasonably

For this RFE, the problem is with short, one-line functions in a class
definition. For example:

  class foo
    void some_method(int param)
    { body(param); }

clang-format insists on breaking the body. AFAICT, there are options for
keeping the body on a single line if that line is *shared* with the method
prototype, but no option if there is a break between the prototype and the

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/20180606/18e78106/attachment.html>

More information about the llvm-bugs mailing list