summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-05-22 13:25:26 +0000
committerDaniel Jasper <djasper@google.com>2014-05-22 13:25:26 +0000
commitbd630737bd4f55e3960b1331ead863342053680c (patch)
tree73afdf3722c43f79825c06aa9f1cc292601dae5c /clang/unittests/Format/FormatTest.cpp
parent15ff71deea1652f7312d899e706560544f6f7878 (diff)
downloadbcm5719-llvm-bd630737bd4f55e3960b1331ead863342053680c.tar.gz
bcm5719-llvm-bd630737bd4f55e3960b1331ead863342053680c.zip
clang-format: Fix corner case in AllowShortBlocksOnASingleLine.
Before: template <int> struct A4 { A4() { } }; After: template <int i> struct A4 { A4() {} }; This fixes llvm.org/PR19813 (at least the part that isn't working as intended). llvm-svn: 209438
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 729eeaf4399..b3fb776a7a6 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -378,6 +378,11 @@ TEST_F(FormatTest, FormatShortBracedStatements) {
"}",
AllowSimpleBracedStatements);
+ verifyFormat("template <int> struct A2 {\n"
+ " struct B {};\n"
+ "};",
+ AllowSimpleBracedStatements);
+
AllowSimpleBracedStatements.AllowShortIfStatementsOnASingleLine = false;
verifyFormat("if (true) {\n"
" f();\n"
OpenPOWER on IntegriCloud