[llvm-bugs] [Bug 40516] New: Weird line breaks for C++ operators

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jan 29 08:00:47 PST 2019


            Bug ID: 40516
           Summary: Weird line breaks for C++ operators
           Product: clang
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: alexfh at google.com
          Reporter: labath at google.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

$ cat a.cpp
const NamespaceName::VeryLongClassName
&NamespaceName::VeryLongClassName::myFunction() {
  // do stuff

const NamespaceName::VeryLongClassName
&NamespaceName::VeryLongClassName::operator++() {
  // do stuff
$ ~/ll/build/opt/bin/clang-format -style=LLVM a.cpp
const NamespaceName::VeryLongClassName &
NamespaceName::VeryLongClassName::myFunction() {
  // do stuff

const NamespaceName::VeryLongClassName &NamespaceName::VeryLongClassName::
operator++() {
  // do stuff

The way clang-format has broken the declaration of operator++ is very
unfortunate. I'd expect it to be formatted the same way as the member function

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/20190129/ad63bba2/attachment.html>

More information about the llvm-bugs mailing list