From 60c270764e2fe0d2e212dd859f9983fe0cc4eb66 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Wed, 13 May 2015 08:16:00 +0000 Subject: clang-format: Support column layout with comment after {. Before: vector iiiiiiiiiiiiiii = { // 1111111111, 2222222222, 33333333333, 4444444444, // 111111111, 222222222, 3333333333, 444444444, // 11111111, 22222222, 333333333, 44444444}; After: vector iiiiiiiiiiiiiii = { // 1111111111, 2222222222, 33333333333, 4444444444, // 111111111, 222222222, 3333333333, 444444444, // 11111111, 22222222, 333333333, 44444444}; llvm-svn: 237233 --- clang/unittests/Format/FormatTest.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/unittests/Format/FormatTest.cpp') diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 4072fef2e0f..371fa0f3d22 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -6368,6 +6368,12 @@ TEST_F(FormatTest, FormatsBracedListsInColumnLayout) { " /**/ /**/};", getLLVMStyleWithColumns(39)); + // Trailing comment in the first line. + verifyFormat("vector iiiiiiiiiiiiiii = { //\n" + " 1111111111, 2222222222, 33333333333, 4444444444, //\n" + " 111111111, 222222222, 3333333333, 444444444, //\n" + " 11111111, 22222222, 333333333, 44444444};"); + // With nested lists, we should either format one item per line or all nested // lists one on line. // FIXME: For some nested lists, we can do better. -- cgit v1.2.3