[llvm-bugs] [Bug 42302] New: Clang-format ternary operator wrong alignment of ':' in second line

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 17 13:48:37 PDT 2019


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

            Bug ID: 42302
           Summary: Clang-format ternary operator wrong alignment of ':'
                    in second line
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: robb at poczta.fm
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true

When a ternary operator is in a line following a very long type, the (':') on
the next line is aligned with ('?') as if long type name was missing.


```
    {
        VeryLongLongLongLongTypeName name;
        short                        s;
        std::string                  str = ext_bool ? "Hello World!\n" //
                                   : "Goodbye World;)"
    }
```

it is aligned as if, there were no longer declarations:

```
        std::string str = ext_bool ? "Hello World!\n" //
                                   : "Goodbye World;)"
```

-- 
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/20190617/36ecf4c8/attachment.html>


More information about the llvm-bugs mailing list