diff options
| author | Daniel Jasper <djasper@google.com> | 2014-05-22 09:00:33 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2014-05-22 09:00:33 +0000 |
| commit | 3948516a03ba3405e2578d27fcaf898e58dc88b5 (patch) | |
| tree | ec4165433a4d0f0296e231614e95a83f801d6790 /clang/unittests/Format/FormatTest.cpp | |
| parent | 515ad8c490582d9b3b71274ed9255dc4a23c4610 (diff) | |
| download | bcm5719-llvm-3948516a03ba3405e2578d27fcaf898e58dc88b5.tar.gz bcm5719-llvm-3948516a03ba3405e2578d27fcaf898e58dc88b5.zip | |
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.
llvm-svn: 209412
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 3dbada81f01..af0b5a1cb61 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/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) { |

