aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-01-23 12:58:14 +0000
committerDaniel Jasper <djasper@google.com>2013-01-23 12:58:14 +0000
commit20d3583857c2cc99dcc9c27ff5f23916df9c0812 (patch)
tree2acc41d0440fd2e0147720561bacac8425b50a27 /unittests/Format/FormatTest.cpp
parent7006e7ebc0098b7627bd3cc13367ea576c25dcbb (diff)
Fix the formatting of pointer/reference types in range-based for loops.
Before: for (int & a : Values) {} After: for (int &a : Values) {} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173259 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 279b61c262..d1af838a73 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -1356,6 +1356,10 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
verifyIndependentOfContext("if (*b[i])");
verifyIndependentOfContext("if (int *a = (&b))");
verifyIndependentOfContext("while (int *a = &b)");
+ verifyFormat("void f() {\n"
+ " for (const int &v : Values) {\n"
+ " }\n"
+ "}");
verifyIndependentOfContext("A = new SomeType *[Length]();");
verifyGoogleFormat("A = new SomeType* [Length]();");