diff options
-rw-r--r-- | lib/Format/TokenAnnotator.cpp | 2 | ||||
-rw-r--r-- | unittests/Format/FormatTest.cpp | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp index 6fa79813fa..185a45d43d 100644 --- a/lib/Format/TokenAnnotator.cpp +++ b/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/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index abb2b5819c..45c8e81dc7 100644 --- a/unittests/Format/FormatTest.cpp +++ b/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" |