summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/UnwrappedLineFormatter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Format/UnwrappedLineFormatter.cpp')
-rw-r--r--clang/lib/Format/UnwrappedLineFormatter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineFormatter.cpp b/clang/lib/Format/UnwrappedLineFormatter.cpp
index 20298d33947..7e1fc3b1dd5 100644
--- a/clang/lib/Format/UnwrappedLineFormatter.cpp
+++ b/clang/lib/Format/UnwrappedLineFormatter.cpp
@@ -305,7 +305,8 @@ private:
if (Line->First->isOneOf(tok::kw_case, tok::kw_default, tok::r_brace))
break;
if (Line->First->isOneOf(tok::kw_if, tok::kw_for, tok::kw_switch,
- tok::kw_while, tok::comment))
+ tok::kw_while, tok::comment) ||
+ Line->Last->is(tok::comment))
return 0;
Length += I[1 + NumStmts]->Last->TotalLength + 1; // 1 for the space.
}
OpenPOWER on IntegriCloud