summaryrefslogtreecommitdiff
path: root/unittests/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-05-22 09:00:33 +0000
committerDaniel Jasper <djasper@google.com>2014-05-22 09:00:33 +0000
commit643549ba9307e74cae7b5a5bf1711e469f3b190e (patch)
tree22645a159142c9cd5af111a3655c8130eca282f8 /unittests/Format
parentb725d270dbf2b9d7e5dc8099c243a19c6fbb4849 (diff)
downloadclang-643549ba9307e74cae7b5a5bf1711e469f3b190e.tar.gz
clang-643549ba9307e74cae7b5a5bf1711e469f3b190e.tar.bz2
clang-643549ba9307e74cae7b5a5bf1711e469f3b190e.tar.xz
clang-format: Correctly identify multiplications in braces init lists.
Before: int i{a *b}; After: int i{a * b}; Also fix unrelated issue where braced init lists were counted as blocks and prevented single-line functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209412 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format')
-rw-r--r--unittests/Format/FormatTest.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 3dbada81f0..af0b5a1cb6 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -4694,6 +4694,7 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
verifyFormat("auto PointerBinding = [](const char *S) {};");
verifyFormat("typedef typeof(int(int, int)) *MyFunc;");
verifyIndependentOfContext("typedef void (*f)(int *a);");
+ verifyIndependentOfContext("int i{a * b};");
verifyIndependentOfContext("InvalidRegions[*R] = 0;");
@@ -7044,9 +7045,7 @@ TEST_F(FormatTest, DoNotCreateUnreasonableUnwrappedLines) {
TEST_F(FormatTest, DoNotPrematurelyEndUnwrappedLineForReturnStatements) {
verifyFormat(
- "void f() {\n"
- " return C{param1, param2}.SomeCall(param1, param2);\n"
- "}\n");
+ "void f() { return C{param1, param2}.SomeCall(param1, param2); }");
}
TEST_F(FormatTest, FormatsClosingBracesInEmptyNestedBlocks) {