summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-06-02 11:54:20 +0000
committerDaniel Jasper <djasper@google.com>2014-06-02 11:54:20 +0000
commit804ec3446da1c01af7206c526ef5fecec3e6ae60 (patch)
tree1f4aed0d71d7cea6bab77b43d2ac95af79768047 /unittests
parent278a968bf08dcc40fd5b302f73a8f1744d6c7d92 (diff)
downloadclang-804ec3446da1c01af7206c526ef5fecec3e6ae60.tar.gz
clang-804ec3446da1c01af7206c526ef5fecec3e6ae60.tar.bz2
clang-804ec3446da1c01af7206c526ef5fecec3e6ae60.tar.xz
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(); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210017 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Format/FormatTest.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 2718a8992c..40789640e2 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -4714,6 +4714,7 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
verifyFormat("typedef typeof(int(int, int)) *MyFunc;");
verifyIndependentOfContext("typedef void (*f)(int *a);");
verifyIndependentOfContext("int i{a * b};");
+ verifyIndependentOfContext("aaa && aaa->f();");
verifyIndependentOfContext("InvalidRegions[*R] = 0;");