Improve handling of comments in static initializers.
authorDaniel Jasper <djasper@google.com>
Thu, 17 Jan 2013 12:53:34 +0000 (12:53 +0000)
committerDaniel Jasper <djasper@google.com>
Thu, 17 Jan 2013 12:53:34 +0000 (12:53 +0000)
commit11cb81cd6ffc6f500280798a22069167821f427f
treeb02efbb4d8ad0bbfebf57776372baa812785b09e
parente528f67c142b963e1e70d47c5629b29d56d95d9d
Improve handling of comments in static initializers.

Also adding more tests.

We can now keep the formatting of something like:

static SomeType type = { aaaaaaaaaaaaaaaaaaaa, /* comment */
                         aaaaaaaaaaaaaaaaaaaa /* comment */,
                         /* comment */ aaaaaaaaaaaaaaaaaaaa,
                         aaaaaaaaaaaaaaaaaaaa, // comment
                         aaaaaaaaaaaaaaaaaaaa };

Note that the comment in the first line is handled like a trailing line comment
as that is likely what the user intended.

llvm-svn: 172711
clang/lib/Format/Format.cpp
clang/unittests/Format/FormatTest.cpp