summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-01-28 15:16:31 +0000
committerDaniel Jasper <djasper@google.com>2013-01-28 15:16:31 +0000
commitd2639ef5029b0d29f4ef643f759e987aa29f65a6 (patch)
tree3832df81a2428c33053ab1494e8999562ce7e88a /clang/unittests/Format/FormatTest.cpp
parent9f7e8c143302fe051a8c8fca45565cde1bee88a7 (diff)
downloadbcm5719-llvm-d2639ef5029b0d29f4ef643f759e987aa29f65a6.tar.gz
bcm5719-llvm-d2639ef5029b0d29f4ef643f759e987aa29f65a6.zip
Let clang-format break after a function's return type.
Before: TypeSpecDecl *TypeSpecDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *II, Type *T) {} After: TypeSpecDecl * TypeSpecDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *II, Type *T) {} This fixes llvm.org/PR14717. llvm-svn: 173688
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 417dc9e9a24..6b9b84de269 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -1504,13 +1504,13 @@ TEST_F(FormatTest, FormatsFunctionTypes) {
verifyFormat("int(*func)(void *);");
}
-TEST_F(FormatTest, DoesNotBreakBeforePointerOrReference) {
- verifyFormat("int *someFunction(int LoooooooooooooooongParam1,\n"
- " int LoooooooooooooooongParam2) {\n}");
+TEST_F(FormatTest, BreaksFunctionDeclarations) {
+ verifyFormat("int *someFunction(int LoooooooooooooooooooongParam1,\n"
+ " int LoooooooooooooooooooongParam2) {\n}");
verifyFormat(
- "TypeSpecDecl *TypeSpecDecl::Create(ASTContext &C, DeclContext *DC,\n"
- " SourceLocation L, IdentifierIn *II,\n"
- " Type *T) {\n}");
+ "TypeSpecDecl *\n"
+ "TypeSpecDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,\n"
+ " IdentifierIn *II, Type *T) {\n}");
}
TEST_F(FormatTest, LineStartsWithSpecialCharacter) {
OpenPOWER on IntegriCloud