summaryrefslogtreecommitdiffstats
path: root/clang/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
commit420d7d333e593320613889eadb66bfe16b591908 (patch)
tree4ca0960707b62c359795df4c2a8be49142768bbc /clang/unittests/Format/FormatTest.cpp
parent4766fe6f10ba99add6f8237c49072a4a766beeff (diff)
downloadbcm5719-llvm-420d7d333e593320613889eadb66bfe16b591908.tar.gz
bcm5719-llvm-420d7d333e593320613889eadb66bfe16b591908.zip
Fix the formatting of pointer/reference types in range-based for loops.
Before: for (int & a : Values) {} After: for (int &a : Values) {} llvm-svn: 173259
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 279b61c262b..d1af838a730 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/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]();");
OpenPOWER on IntegriCloud