summaryrefslogtreecommitdiffstats
path: root/clang/unittests
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-02-05 13:43:04 +0000
committerDaniel Jasper <djasper@google.com>2014-02-05 13:43:04 +0000
commit0c214fa2e3a9fcaca35881bb266d1923e5488610 (patch)
tree8f34c1a5dc3b98da8493e7f86cf039b87584e748 /clang/unittests
parent3bb8fbfa3eb0812779163091393b69cb97d78c86 (diff)
downloadbcm5719-llvm-0c214fa2e3a9fcaca35881bb266d1923e5488610.tar.gz
bcm5719-llvm-0c214fa2e3a9fcaca35881bb266d1923e5488610.zip
clang-format: Don't indent relative to unary operators.
It seems like most people see unary operators more like part of the subsequent identifier and find relative indentation odd. Before: aaaaaaaaaa(!aaaaaaaaaa( // break aaaaa)); After: aaaaaaaaaa(!aaaaaaaaaa( // break aaaaa)); llvm-svn: 200840
Diffstat (limited to 'clang/unittests')
-rw-r--r--clang/unittests/Format/FormatTest.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 5de15e3c2b9..0f112a13f19 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -4219,14 +4219,12 @@ TEST_F(FormatTest, UnderstandsUnaryOperators) {
verifyFormat("int a = i /* confusing comment */++;");
}
-TEST_F(FormatTest, IndentsRelativeToUnaryOperators) {
+TEST_F(FormatTest, DoesNotIndentRelativeToUnaryOperators) {
verifyFormat("if (!aaaaaaaaaa( // break\n"
- " aaaaa)) {\n"
+ " aaaaa)) {\n"
"}");
verifyFormat("aaaaaaaaaa(!aaaaaaaaaa( // break\n"
- " aaaaa));");
-
- // Only indent relative to unary operators if the expression is nested.
+ " aaaaa));");
verifyFormat("*aaa = aaaaaaa( // break\n"
" bbbbbb);");
}
OpenPOWER on IntegriCloud