summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/BreakableToken.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Format/BreakableToken.cpp')
-rw-r--r--clang/lib/Format/BreakableToken.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Format/BreakableToken.cpp b/clang/lib/Format/BreakableToken.cpp
index a5fabfe2379..4735ab3564f 100644
--- a/clang/lib/Format/BreakableToken.cpp
+++ b/clang/lib/Format/BreakableToken.cpp
@@ -316,7 +316,8 @@ BreakableBlockComment::BreakableBlockComment(
unsigned OriginalStartColumn, bool FirstInLine, bool InPPDirective,
encoding::Encoding Encoding, const FormatStyle &Style)
: BreakableComment(Token, StartColumn, InPPDirective, Encoding, Style),
- DelimitersOnNewline(false) {
+ DelimitersOnNewline(false),
+ UnbreakableTailLength(Token.UnbreakableTailLength) {
assert(Tok.is(TT_BlockComment) &&
"block comment section must start with a block comment");
@@ -497,7 +498,8 @@ unsigned BreakableBlockComment::getRangeLength(unsigned LineIndex,
unsigned BreakableBlockComment::getRemainingLength(unsigned LineIndex,
unsigned Offset,
unsigned StartColumn) const {
- return getRangeLength(LineIndex, Offset, StringRef::npos, StartColumn);
+ return UnbreakableTailLength +
+ getRangeLength(LineIndex, Offset, StringRef::npos, StartColumn);
}
unsigned BreakableBlockComment::getContentStartColumn(unsigned LineIndex,
OpenPOWER on IntegriCloud