From https://bugs.llvm.org/show_bug.cgi?id=40516
$ 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 }
What was happening is that the split penalty before operator was being set to
a smaller value by a prior if block. Moved checks around to fix this and added a
regression test.