[llvm-bugs] [Bug 49481] New: Feature request: when breaking function call / prototype, put parenthesis on next line

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 8 14:43:29 PST 2021


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

            Bug ID: 49481
           Summary: Feature request: when breaking function call /
                    prototype, put parenthesis on next line
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: simon.marchi at polymtl.ca
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Following this message:

https://sourceware.org/pipermail/gdb/2021-March/049225.html

I am logging a bug regarding one issue that is preventing using clang-format
for the GDB project.

When starting an argument/parameter list on the next line because the function
name or some arguments/parameters are too long, we put the parenthesis on the
next line.  For example:

void
this_is_a_quite_long_function_name
  (this_is_a_very_very_very_very_very_very_long_struct_name p)
{
}

I tried all kinds of configuration tweaks, it doesn't seem to be possible to
convince clang-format to do that.  It prefers the parenthesis on the first
line:

void
this_is_a_quite_long_function_name (
  this_is_a_very_very_very_very_very_very_long_struct_name p)
{
}

Similarly, when calling this function, we use:

int
main ()
{
  this_is_a_quite_long_function_name
    (this_is_a_relatively_long_variable_name_that_causes_wrapping);
}

which gets transformed to

int
main ()
{
  this_is_a_quite_long_function_name (
    this_is_a_relatively_long_variable_name_that_causes_wrapping);
}

-- 
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/20210308/8b114f71/attachment.html>


More information about the llvm-bugs mailing list