diff options
author | Daniel Jasper <djasper@google.com> | 2013-07-05 07:58:34 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-07-05 07:58:34 +0000 |
commit | 1bc1b502ec3cde40c0b9004ccb6feab11419128c (patch) | |
tree | fd25aff9a94204f437cc9411f610721840bd8a1f /clang/unittests/Format/FormatTest.cpp | |
parent | 0f328447b638a3518b6edbe28e9bfa252e2c1a7e (diff) | |
download | bcm5719-llvm-1bc1b502ec3cde40c0b9004ccb6feab11419128c.tar.gz bcm5719-llvm-1bc1b502ec3cde40c0b9004ccb6feab11419128c.zip |
Don't break after a "(" following a binary operator.
Additionally, allow breaking after c-style casts, but with a high
penalty.
Before:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *foo = (
aaaaaaaaaaaaaaaaa *)bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
After:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *foo = (aaaaaaaaaaaaaaaaa *)
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
This fixes llvm.org/PR16049.
llvm-svn: 185685
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index c1fdab7cfca..ed06bacd87d 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -3485,6 +3485,9 @@ TEST_F(FormatTest, FormatsCasts) { verifyFormat("virtual void foo(int *a, char *) const;"); verifyFormat("int a = sizeof(int *) + b;"); verifyFormat("int a = alignof(int *) + b;", getGoogleStyle()); + + verifyFormat("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *foo = (aaaaaaaaaaaaaaaaa *)\n" + " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;"); } TEST_F(FormatTest, FormatsFunctionTypes) { |