diff --git a/clang/lib/Format/BreakableToken.cpp b/clang/lib/Format/BreakableToken.cpp --- a/clang/lib/Format/BreakableToken.cpp +++ b/clang/lib/Format/BreakableToken.cpp @@ -41,8 +41,8 @@ static StringRef getLineCommentIndentPrefix(StringRef Comment, const FormatStyle &Style) { - static const char *const KnownCStylePrefixes[] = {"///<", "//!<", "///", "//", - "//!"}; + static const char *const KnownCStylePrefixes[] = {"///<", "//!<", "///", + "//", "//!", "//:"}; static const char *const KnownTextProtoPrefixes[] = {"//", "#", "##", "###", "####"}; ArrayRef KnownPrefixes(KnownCStylePrefixes); diff --git a/clang/unittests/Format/FormatTestComments.cpp b/clang/unittests/Format/FormatTestComments.cpp --- a/clang/unittests/Format/FormatTestComments.cpp +++ b/clang/unittests/Format/FormatTestComments.cpp @@ -702,6 +702,12 @@ " // long 1 2 3 4 5 6\n" "}", getLLVMStyleWithColumns(20))); + + EXPECT_EQ("//: A comment that\n" + "//: doesn't fit on\n" + "//: one line", + format("//: A comment that doesn't fit on one line", + getLLVMStyleWithColumns(20))); } TEST_F(FormatTestComments, PreservesHangingIndentInCxxComments) {