summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Format/BreakableToken.cpp5
-rw-r--r--clang/unittests/Format/FormatTest.cpp1
2 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Format/BreakableToken.cpp b/clang/lib/Format/BreakableToken.cpp
index 5c3ad9cee2b..10ba1f39a55 100644
--- a/clang/lib/Format/BreakableToken.cpp
+++ b/clang/lib/Format/BreakableToken.cpp
@@ -337,6 +337,11 @@ BreakableBlockComment::replaceWhitespaceBefore(unsigned LineIndex,
// contain a trailing whitespace.
Prefix = Prefix.substr(0, 1);
}
+ } else {
+ if (StartOfLineColumn[LineIndex] == 1) {
+ // This lines starts immediately after the decorating *.
+ Prefix = Prefix.substr(0, 1);
+ }
}
unsigned WhitespaceOffsetInToken =
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 1f4f4806c3b..b2e53a53348 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -3640,6 +3640,7 @@ TEST_F(FormatTest, BlockComments) {
format("#define A\n"
"/* */someCall(parameter);",
getLLVMStyleWithColumns(15)));
+ EXPECT_EQ("/*\n**\n*/", format("/*\n**\n*/"));
FormatStyle NoBinPacking = getLLVMStyle();
NoBinPacking.BinPackParameters = false;
OpenPOWER on IntegriCloud