diff options
| author | Daniel Jasper <djasper@google.com> | 2013-05-03 14:50:50 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2013-05-03 14:50:50 +0000 |
| commit | 72463d32e0af5bad307f27a44d993ade39ecc2cd (patch) | |
| tree | 654efc682ae0e2b31d9ad08c360f2d65e1e08253 /clang | |
| parent | ff2be22b9122c6f3c1e5d268c17db0ef5f30d806 (diff) | |
| download | bcm5719-llvm-72463d32e0af5bad307f27a44d993ade39ecc2cd.tar.gz bcm5719-llvm-72463d32e0af5bad307f27a44d993ade39ecc2cd.zip | |
Add space between ; and (.
Before: for (int i = 0;(i < 10); ++i) {}
After: for (int i = 0; (i < 10); ++i) {}
llvm-svn: 181020
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 2 | ||||
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 6fa79813fab..185a45d43d1 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1048,7 +1048,7 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line, return Line.Type == LT_ObjCDecl || Left.isOneOf(tok::kw_if, tok::kw_for, tok::kw_while, tok::kw_switch, tok::kw_return, tok::kw_catch, tok::kw_new, - tok::kw_delete); + tok::kw_delete, tok::semi); } if (Left.is(tok::at) && Right.FormatTok.Tok.getObjCKeywordID() != tok::objc_not_keyword) diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index abb2b5819c4..45c8e81dc75 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -302,6 +302,7 @@ TEST_F(FormatTest, FormatsForLoop) { verifyFormat("for (;;) {\n" " f();\n" "}"); + verifyFormat("for (int i = 0; (i < 10); ++i) {\n}"); verifyFormat( "for (std::vector<UnwrappedLine>::iterator I = UnwrappedLines.begin(),\n" |

