[llvm-bugs] [Bug 45639] New: clang-format splits up the brackets of C++17 attribute [[ ]] with PenaltyExcessCharacter

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Apr 22 08:57:16 PDT 2020


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

            Bug ID: 45639
           Summary: clang-format splits up the brackets of C++17 attribute
                    [[ ]] with PenaltyExcessCharacter
           Product: clang
           Version: 10.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rejett at microsoft.com
                CC: djasper at google.com, joblac at microsoft.com,
                    klimek at google.com, llvm-bugs at lists.llvm.org

I've tried to simplify this down as much as I can:

test.cpp:
```
void SomeLongClassName::ALongMethodNameInThatClass([[maybe_unused]] const
shared_ptr<ALongTypeName>& argumentNameForThat
LongType) {

}
```


.clang-format:
```
Standard: c++17
PenaltyExcessCharacter: 10
```


clang-format.exe -style=file test.cpp:
```
void SomeLongClassName::ALongMethodNameInThatClass([
    [maybe_unused]] const shared_ptr<ALongTypeName>
&argumentNameForThatLongType) {

}
```

Note how the first [ of [[maybe_unused]] separated from the rest. I would
expect the entirety of [[maybe_unused]] to be together.

-- 
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/20200422/5ac0e61b/attachment.html>


More information about the llvm-bugs mailing list