diff options
author | Daniel Jasper <djasper@google.com> | 2013-02-15 20:33:06 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-02-15 20:33:06 +0000 |
commit | eb50c676bac72a27bc47ece11a0880c2ab4503b5 (patch) | |
tree | 87102c19398ec018cd7eacb424215f2437852a57 /clang/unittests | |
parent | b7eec015d05c0494b20ed0d9faf86562a460f1f4 (diff) | |
download | bcm5719-llvm-eb50c676bac72a27bc47ece11a0880c2ab4503b5.tar.gz bcm5719-llvm-eb50c676bac72a27bc47ece11a0880c2ab4503b5.zip |
Recognize < and > as binary expressions in builder-type calls.
The current heuristic assumes that there can't be binary operators in
builder-type calls (excluding assigments). However, it also excluded
< and > in general, which is wrong. Now they are only excluded if they
are template parameters.
Before:
return aaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa()i
.aaaaaa() < aaaaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa();
After:
return aaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa() <
aaaaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa();
llvm-svn: 175291
Diffstat (limited to 'clang/unittests')
-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 1d3e16f6dd9..a41c713ac51 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -1221,6 +1221,9 @@ TEST_F(FormatTest, FormatsBuilderPattern) { " .StartsWith(\".eh_frame\", ORDER_EH_FRAME).StartsWith(\".init\", ORDER_INIT)\n" " .StartsWith(\".fini\", ORDER_FINI).StartsWith(\".hash\", ORDER_HASH)\n" " .Default(ORDER_TEXT);\n"); + + verifyFormat("return aaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa() <\n" + " aaaaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa();"); } TEST_F(FormatTest, DoesNotBreakTrailingAnnotation) { |