summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-07-09 07:43:55 +0000
committerDaniel Jasper <djasper@google.com>2013-07-09 07:43:55 +0000
commit6331da06725dc99fe88f875647b69c80168d84dc (patch)
treedf2933c2accbc84796490e03464b2f7b1c6cba3f /clang/unittests/Format/FormatTest.cpp
parentdbbf09b28ec72c5834d2b35ccddfaf99ef2671de (diff)
downloadbcm5719-llvm-6331da06725dc99fe88f875647b69c80168d84dc.tar.gz
bcm5719-llvm-6331da06725dc99fe88f875647b69c80168d84dc.zip
Format overloaded operators like other functions.
This fixes llvm.org/PR16328 (at least partially). Before: SomeLoooooooooooooooooooooooooooooogType operator<<( const SomeLooooooooogType &a, const SomeLooooooooogType &b); After: SomeLoooooooooooooooooooooooooooooogType operator<<(const SomeLooooooooogType &a, const SomeLooooooooogType &b); llvm-svn: 185908
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 2afd91e482f..6c70ebb11a7 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -2456,6 +2456,13 @@ TEST_F(FormatTest, BreaksFunctionDeclarations) {
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n"
" bbbb bbbb);");
+
+ // Treat overloaded operators like other functions.
+ verifyFormat("SomeLoooooooooooooooooooooooooogType\n"
+ "operator>(const SomeLoooooooooooooooooooooooooogType &other);");
+ verifyGoogleFormat(
+ "SomeLoooooooooooooooooooooooooooooogType operator<<(\n"
+ " const SomeLooooooooogType &a, const SomeLooooooooogType &b);");
}
TEST_F(FormatTest, BreaksFunctionDeclarationsWithTrailingTokens) {
OpenPOWER on IntegriCloud