summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-07-30 22:37:19 +0000
committerDaniel Jasper <djasper@google.com>2013-07-30 22:37:19 +0000
commit62c0ac0acfbd59b60b5c648b4af09601dc4dff3d (patch)
treee628e09a1965f30b57e101007f3f9aeb5bf0d9f4 /clang/unittests/Format/FormatTest.cpp
parentca6384aeebd79bcc9f9e9ee06eda62569efd106b (diff)
downloadbcm5719-llvm-62c0ac0acfbd59b60b5c648b4af09601dc4dff3d.tar.gz
bcm5719-llvm-62c0ac0acfbd59b60b5c648b4af09601dc4dff3d.zip
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
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index ebb7722a649..4a28cca222e 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -3372,6 +3372,8 @@ TEST_F(FormatTest, UnderstandsTemplateParameters) {
" 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 @@ TEST_F(FormatTest, UnderstandContextOfRecordTypeKeywords) {
" : 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.
OpenPOWER on IntegriCloud