summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
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
commit7d028298ceecaed3270f947baaea94b58965e642 (patch)
tree85293a3740f1c581c4e56398ec4cd9be27b4aa68 /clang/unittests/Format/FormatTest.cpp
parent66f6f804e5b6fd4dc086bc76fa0ce1789ad6f8c1 (diff)
downloadbcm5719-llvm-7d028298ceecaed3270f947baaea94b58965e642.tar.gz
bcm5719-llvm-7d028298ceecaed3270f947baaea94b58965e642.zip
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
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 2718a8992cd..40789640e25 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/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;");
OpenPOWER on IntegriCloud