summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/UnwrappedLineParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.cpp')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index bdea42a2eb4..c2cb5b8027b 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -106,6 +106,12 @@ void UnwrappedLineParser::parseComment() {
}
void UnwrappedLineParser::parseStatement() {
+ // Consume leading line comments, e.g. for branches without compounds.
+ while (FormatTok.Tok.is(tok::comment)) {
+ nextToken();
+ addUnwrappedLine();
+ }
+
switch (FormatTok.Tok.getKind()) {
case tok::kw_public:
case tok::kw_protected:
OpenPOWER on IntegriCloud