summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-07-09 09:06:29 +0000
committerDaniel Jasper <djasper@google.com>2013-07-09 09:06:29 +0000
commitb1f74a815294822f32b80210df64c6cf1492952d (patch)
tree5a534c94edf8d6ebee78a35f187692c209980741 /clang/unittests/Format/FormatTest.cpp
parentf7f252d025ed6592fc0d999b069ab772517ad765 (diff)
downloadbcm5719-llvm-b1f74a815294822f32b80210df64c6cf1492952d.tar.gz
bcm5719-llvm-b1f74a815294822f32b80210df64c6cf1492952d.zip
Fix alignment of closing brace in braced initializers.
Before: someFunction(OtherParam, BracedList{ // comment 1 (Forcing intersting break) param1, param2, // comment 2 param3, param4 }); After: someFunction(OtherParam, BracedList{ // comment 1 (Forcing intersting break) param1, param2, // comment 2 param3, param4 }); To do so, the UnwrappedLineParser now stores the information about the kind of brace in the FormatToken. llvm-svn: 185914
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 6c70ebb11a7..417c50cd2cc 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -3785,6 +3785,13 @@ TEST_F(FormatTest, LayoutCxx11ConstructorBraceInitializers) {
" bbbbbbbbbbbbbbbbbbbb, bbbbb };");
verifyFormat("DoSomethingWithVector({} /* No data */);");
verifyFormat("DoSomethingWithVector({ {} /* No data */ }, { { 1, 2 } });");
+ verifyFormat(
+ "someFunction(OtherParam, BracedList{\n"
+ " // comment 1 (Forcing intersting break)\n"
+ " param1, param2,\n"
+ " // comment 2\n"
+ " param3, param4\n"
+ " });");
FormatStyle NoSpaces = getLLVMStyle();
NoSpaces.SpacesInBracedLists = false;
OpenPOWER on IntegriCloud