[llvm-bugs] [Bug 34882] New: clang-format produces unexpected function parameter formatting

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Oct 8 20:14:32 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=34882

            Bug ID: 34882
           Summary: clang-format produces unexpected function parameter
                    formatting
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: RytoEX at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Created attachment 19249
  --> https://bugs.llvm.org/attachment.cgi?id=19249&action=edit
clang-format rules

When testing clang-format on a project, I noticed that it sometimes
aggressively tries to start function parameters on a new line separate from the
function return type and name, even though allowing one or two parameters on
the same line should not have reached the ColumnLimit (80).  I've seen this
behavior on clang-format 4.0 and 5.0.  I didn't see anything in the
clang-format rules being used that should cause this, though I'll admit that
I'm fairly new to LLVM/clang, so I may have missed something.

I've attached the clang-format rules file (.clang-format) to this bug report. 
I've also provided examples for input, expected output, and actual output as
raw text below.  I can attach files for those as well, if needed.  Please let
me know if you require any additional information or examples.


Input:
static inline void test_function_1(some_long_type_name example,
a_short_type_name var, int an_int)
{
        return;
}


Expected Output:
static inline void test_function_1(some_long_type_name example,
                a_short_type_name var, int an_int)
{
        return;
}


Actual Output:
static inline void test_function_1(
                some_long_type_name example, a_short_type_name var, int an_int)
{
        return;
}

-- 
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/20171009/55985827/attachment.html>


More information about the llvm-bugs mailing list