clang-format: Fix enum formatting with specific comment.
Before:
enum Fruit { //
APPLE,
PEAR };
After:
enum Fruit { //
APPLE,
PEAR
};
llvm-svn: 210522
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 02636a7..baf05a9 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -1900,6 +1900,10 @@
"\n"
" THREE\n"
"}"));
+ verifyFormat("enum E { // comment\n"
+ " ONE,\n"
+ " TWO\n"
+ "};");
}
TEST_F(FormatTest, FormatsEnumsWithErrors) {
@@ -5410,7 +5414,8 @@
" BracedList{ // comment 1 (Forcing interesting break)\n"
" param1, param2,\n"
" // comment 2\n"
- " param3, param4 });",
+ " param3, param4\n"
+ " });",
ExtraSpaces);
verifyFormat(
"std::this_thread::sleep_for(\n"