clang-format: Improve detection of templates.
Before:
template <typename... Types>
typename enable_if < 0<sizeof...(Types)>::type Foo() {}
After:
template <typename... Types>
typename enable_if<0 < sizeof...(Types)>::type Foo() {}
llvm-svn: 187458
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index ebb7722..4a28cca2 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -3372,6 +3372,8 @@
" while (a < b && c > d) {\n"
" }\n"
"}");
+ verifyFormat("template <typename... Types>\n"
+ "typename enable_if<0 < sizeof...(Types)>::type Foo() {}");
}
TEST_F(FormatTest, UnderstandsBinaryOperators) {
@@ -4107,7 +4109,7 @@
" : Implementation(new ImplicitCastMatcher<F>(Other)) {}");
// FIXME: This is still incorrectly handled at the formatter side.
- verifyFormat("template <> struct X < 15, i < 3 && 42 < 50 && 33<28> {};");
+ verifyFormat("template <> struct X < 15, i<3 && 42 < 50 && 33 < 28> {};");
// FIXME:
// This now gets parsed incorrectly as class definition.