summaryrefslogtreecommitdiffstats
path: root/clang/unittests
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-02-13 20:33:44 +0000
committerDaniel Jasper <djasper@google.com>2013-02-13 20:33:44 +0000
commitb9caeacd0213ebbde79d096534b46603106e94b4 (patch)
treeb65d5e98957ebba8c71a7b1342d757a2bbe51122 /clang/unittests
parentf662cff68902ce072e4442810dffe9769ba2dfe7 (diff)
downloadbcm5719-llvm-b9caeacd0213ebbde79d096534b46603106e94b4.tar.gz
bcm5719-llvm-b9caeacd0213ebbde79d096534b46603106e94b4.zip
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() {} llvm-svn: 175074
Diffstat (limited to 'clang/unittests')
-rw-r--r--clang/unittests/Format/FormatTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 8fb4b2acd5e..f72aad7aad6 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud