clang-format: Fix corner case in overloaded operator definitions.
Before:
SomeLoooooooooooooooooooooooooogType operator>
>(const SomeLooooooooooooooooooooooooogType &other);
SomeLoooooooooooooooooooooooooogType // break
operator>>(const SomeLooooooooooooooooooooooooogType &other);
After:
SomeLoooooooooooooooooooooooooogType
operator>>(const SomeLooooooooooooooooooooooooogType &other);
SomeLoooooooooooooooooooooooooogType // break
operator>>(const SomeLooooooooooooooooooooooooogType &other);
This fixes llvm.org/PR16328.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189450 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 5002c9c..51ada26 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -2610,6 +2610,8 @@
// Treat overloaded operators like other functions.
verifyFormat("SomeLoooooooooooooooooooooooooogType\n"
"operator>(const SomeLoooooooooooooooooooooooooogType &other);");
+ verifyFormat("SomeLoooooooooooooooooooooooooogType\n"
+ "operator>>(const SomeLooooooooooooooooooooooooogType &other);");
verifyGoogleFormat(
"SomeLoooooooooooooooooooooooooooooogType operator<<(\n"
" const SomeLooooooooogType &a, const SomeLooooooooogType &b);");