clang-format: Fix special case of binary operator detection.
authorDaniel Jasper <djasper@google.com>
Mon, 2 Jun 2014 11:54:20 +0000 (11:54 +0000)
committerDaniel Jasper <djasper@google.com>
Mon, 2 Jun 2014 11:54:20 +0000 (11:54 +0000)
commit7d028298ceecaed3270f947baaea94b58965e642
tree85293a3740f1c581c4e56398ec4cd9be27b4aa68
parent66f6f804e5b6fd4dc086bc76fa0ce1789ad6f8c1
clang-format: Fix special case of binary operator detection.

There is a pattern where evaluation order is used as control flow.
This patch special-cases a commonly occuring version of this pattern.

Before:
  Aaaaa *aaa = nullptr;
  // ...
  aaa &&aaa->f();

After:
  Aaaaa *aaa = nullptr;
  // ...
  aaa && aaa->f();

llvm-svn: 210017
clang/lib/Format/TokenAnnotator.cpp
clang/unittests/Format/FormatTest.cpp