diff options
| author | Daniel Jasper <djasper@google.com> | 2013-07-09 07:43:55 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2013-07-09 07:43:55 +0000 |
| commit | 6331da06725dc99fe88f875647b69c80168d84dc (patch) | |
| tree | df2933c2accbc84796490e03464b2f7b1c6cba3f /clang/unittests/Format/FormatTest.cpp | |
| parent | dbbf09b28ec72c5834d2b35ccddfaf99ef2671de (diff) | |
| download | bcm5719-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.cpp | 7 |
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) { |

