diff options
author | Daniel Jasper <djasper@google.com> | 2013-02-13 20:33:44 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-02-13 20:33:44 +0000 |
commit | a03ab10f0e4d888139b3b694dd55d176982f72a4 (patch) | |
tree | b6430a75f6b55f092469562b1e84c44698c8e057 /unittests/Format/FormatTest.cpp | |
parent | 778749aa7c2ed73ffeb60065dc015ed62127c8e1 (diff) |
Allow breaking after the return type in function declarations.
This has so far been disabled for Google style, but should be done
before breaking at nested name specifiers or in template parameters.
Before (in Google style):
template <typename T>
aaaaaaaa::aaaaa::aaaaaa<T, aaaaaaaaaaaaaaaaaaaaaaaaa> aaaaaaaaaaaaaaaaaaaaaaaa<
T>::aaaaaaa() {}
After:
template <typename T>
aaaaaaaa::aaaaa::aaaaaa<T, aaaaaaaaaaaaaaaaaaaaaaaaa>
aaaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaa() {}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 8fb4b2acd5..f72aad7aad 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -1763,6 +1763,14 @@ TEST_F(FormatTest, BreaksFunctionDeclarations) { verifyGoogleFormat( "TypeSpecDecl* TypeSpecDecl::Create(\n" " ASTContext& C, DeclContext* DC, SourceLocation L) {\n}"); + verifyGoogleFormat( + "some_namespace::LongReturnType\n" + "long_namespace::SomeVeryLongClass::SomeVeryLongFunction(\n" + " int first_long_parameter, int second_parameter) {\n}"); + + verifyGoogleFormat("template <typename T>\n" + "aaaaaaaa::aaaaa::aaaaaa<T, aaaaaaaaaaaaaaaaaaaaaaaaa>\n" + "aaaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaa() {\n}"); } TEST_F(FormatTest, LineStartsWithSpecialCharacter) { |