clang-format: Fix template declaration line breaking with comment.
Before, clang-format would always insert a linebreak before the comment
in code like:
template <typename T> // T can be A, B or C.
struct S {};
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192297 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 4a51448..10d7413 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -3586,6 +3586,9 @@
" template <typename> class Baaaaaaar>\n"
"struct C {};",
AlwaysBreak);
+ verifyFormat("template <typename T> // T can be A, B or C.\n"
+ "struct C {};",
+ AlwaysBreak);
}
TEST_F(FormatTest, WrapsAtNestedNameSpecifiers) {