Recognize < and > as binary expressions in builder-type calls.
authorDaniel Jasper <djasper@google.com>
Fri, 15 Feb 2013 20:33:06 +0000 (20:33 +0000)
committerDaniel Jasper <djasper@google.com>
Fri, 15 Feb 2013 20:33:06 +0000 (20:33 +0000)
commiteb50c676bac72a27bc47ece11a0880c2ab4503b5
tree87102c19398ec018cd7eacb424215f2437852a57
parentb7eec015d05c0494b20ed0d9faf86562a460f1f4
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
clang/lib/Format/TokenAnnotator.cpp
clang/unittests/Format/FormatTest.cpp