[llvm-bugs] [Bug 33546] New: clang-format: AlignConsecutiveAssignments interferes with AlignAfterOpenBracket=Align

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 21 09:41:20 PDT 2017


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

            Bug ID: 33546
           Summary: clang-format: AlignConsecutiveAssignments interferes
                    with AlignAfterOpenBracket=Align
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: fabian.otto at rohde-schwarz.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

When an assignment is aligned because of AlignConsecutiveAssignments or
AlignConsecutiveDeclarations, additional spaces are inserted. These additional
spaces are not considered when the assignment contains a function call with
arguments that are aligned because of AlignAfterOpenBracket=Align. The function
arguments are not indented deep enough.

Version        : clang-format version 5.0.0 (trunk)
Installer      : LLVM-5.0.0-r303050-win32.exe
Command line   : clang-format input.cpp > output.cpp
Expected output: Unchanged input.cpp

input.cpp:
==========
void f() {
  short var = 0;
  int   i   = my_function(MY_LONG_ARGUMENT_1,
                          MY_LONG_ARGUMENT_2,
                          MY_LONG_ARGUMENT_3,
                          MY_LONG_ARGUMENT_4);
}

output.cpp
==========
void f() {
  short var = 0;
  int   i   = my_function(MY_LONG_ARGUMENT_1,
                      MY_LONG_ARGUMENT_2,
                      MY_LONG_ARGUMENT_3,
                      MY_LONG_ARGUMENT_4);
}

.clang-format:
==============
---
Language: Cpp
BasedOnStyle: LLVM
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
BinPackArguments: false
...

-- 
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/20170621/634e7efa/attachment.html>


More information about the llvm-bugs mailing list